Hi, I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new methods for these tasks in sqlparser.lib.php and call them from sql.php . I would like to know the opinion from the developers about this approach.
Regards Supun
Hi
Dne Thu, 13 Jun 2013 11:51:18 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new methods for these tasks in sqlparser.lib.php and call them from sql.php . I would like to know the opinion from the developers about this approach.
Actually it would be better if those regular expressions would use parser because it would give it more tolerance to comments in SQL.
On Thu, Jun 13, 2013 at 12:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Thu, 13 Jun 2013 11:51:18 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new
methods
for these tasks in sqlparser.lib.php and call them from sql.php . I would like to know the opinion from the developers about this approach.
Actually it would be better if those regular expressions would use parser because it would give it more tolerance to comments in SQL.
Hi Michal, PMA_SQP_parse($sql_query) in sqlparser.lib.php is basically checking the sql query and setting some global variables. Could you please elaborate on how to use that function instead of these regular expressions such that it gives more tolerance to comments in SQL. Thank you.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Hi
Dne Thu, 13 Jun 2013 13:14:43 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
On Thu, Jun 13, 2013 at 12:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Thu, 13 Jun 2013 11:51:18 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new
methods
for these tasks in sqlparser.lib.php and call them from sql.php . I would like to know the opinion from the developers about this approach.
Actually it would be better if those regular expressions would use parser because it would give it more tolerance to comments in SQL.
Hi Michal, PMA_SQP_parse($sql_query) in sqlparser.lib.php is basically checking the sql query and setting some global variables. Could you please elaborate on how to use that function instead of these regular expressions such that it gives more tolerance to comments in SQL.
It returns parsed SQL query, where you can check individial tokens.
Supun Nakandala a écrit :
On Thu, Jun 13, 2013 at 12:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Thu, 13 Jun 2013 11:51:18 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new
methods
for these tasks in sqlparser.lib.php and call them from sql.php . I would like to know the opinion from the developers about this approach.
Actually it would be better if those regular expressions would use parser because it would give it more tolerance to comments in SQL.
Hi Michal, PMA_SQP_parse($sql_query) in sqlparser.lib.php is basically checking the sql query and setting some global variables. Could you please elaborate on how to use that function instead of these regular expressions such that it gives more tolerance to comments in SQL. Thank you.
Hi Supun,
PMA_SQP_analyze() is the one to modify. Look at the 'queryflags' in loop #2 and set a new queryflags value.
Hi, I am transferring the regex statements in the method PMA_getDisplayPropertyParams($sql_query, $is_select) in sql.lib.php to the sql analyzer. I feel like some of the regex expressions are not valid (eg. GROUP SELECT). I would appreciate if someone can validate these regex statements and provide some test queries or guide me so that I can gain the required knowledge in order to test the functionality.
Regards Supun
On Thu, Jun 13, 2013 at 6:33 PM, Marc Delisle marc@infomarc.info wrote:
Supun Nakandala a écrit :
On Thu, Jun 13, 2013 at 12:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Thu, 13 Jun 2013 11:51:18 +0530 Supun Nakandala supun.nakandala@gmail.com napsal(a):
I am refactoring sql.php and I see some places where parsing of the sql query done in the sql.php (eg line 445). I am planning to crate new
methods
for these tasks in sqlparser.lib.php and call them from sql.php . I
would
like to know the opinion from the developers about this approach.
Actually it would be better if those regular expressions would use parser because it would give it more tolerance to comments in SQL.
Hi Michal, PMA_SQP_parse($sql_query) in sqlparser.lib.php is basically checking the sql query and setting some global variables. Could you please elaborate on how to use that function instead of these regular
expressions
such that it gives more tolerance to comments in SQL. Thank you.
Hi Supun,
PMA_SQP_analyze() is the one to modify. Look at the 'queryflags' in loop #2 and set a new queryflags value.
-- Marc Delisle http://infomarc.info
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Le 2013-06-14 15:51, Supun Nakandala a écrit :
Hi, I am transferring the regex statements in the method PMA_getDisplayPropertyParams($sql_query, $is_select) in sql.lib.php to the sql analyzer. I feel like some of the regex expressions are not valid (eg. GROUP SELECT). I would appreciate if someone can validate these regex statements and provide some test queries or guide me so that I can gain the required knowledge in order to test the functionality.
Regards Supun
Hi Supun, first, please use bottom-posting on this list.
Second, are you talking about the regex used to set $is_group? I believe that all these expressions are correct unless you can point us to something suspicious.
To gain the required knowledge, you must be familiar with MySQL syntax. Have a look at [0].
[0] http://dev.mysql.com/doc/refman/5.5/en/language-structure.html