[Phpmyadmin-devel] PMA_SQP_parse() 'pos' attribute

Marc Delisle marc at infomarc.info
Sun Jun 8 14:15:47 CEST 2014

Le 2014-06-05 06:41, Chirayu Chiripal a écrit :
> Hi,
> the value 'pos' attribute as per phpdoc (sqlparser.lib.php, Line 65) is:
> @param int    $pos      Position of an element
> So, it should be the index of first character of the element but from
> [0] it looks like it is set to index of the last character of element +
> 1. Also, for quote_backtick types and few others the value of pos is 0.
> What should be the appropriate value for pos?
> (Considering 0-based indexing)
> 1. position of initial character of the element. (I personally prefer
> this one).
> 2. position of last character of the element.
> 3. position of last character of the element + 1.
> Is it used somewhere yet??, because changing its behaviour can cause
> side effects.
> [0]: http://pastebin.com/EQU3X8H6
> -- 

Hi Chirayu,
this 'pos' value is used to set $section_before_limit, so please do not
change it :)

If you need the index of the first character of the element, feel free
to add something like startpos to the array (and to clarify the
description for 'pos').

Marc Delisle | phpMyAdmin

More information about the Developers mailing list