Comments on: MySQL eval() https://shlomi-noach.github.io/blog/mysql/mysql-eval Blog by Shlomi Noach Fri, 02 Dec 2011 04:59:09 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: MySQL foreach() | code.openark.org https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-61278 Fri, 02 Dec 2011 04:59:09 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-61278 […] MySQL eval() […]

]]>
By: Quoting text JavaScript/Python style | code.openark.org https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-58892 Tue, 15 Nov 2011 06:11:42 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-58892 […] MySQL eval() […]

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50937 Tue, 06 Sep 2011 10:35:24 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50937 Ahhh, the force!

]]>
By: Giuseppe Maxia https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50933 Tue, 06 Sep 2011 10:02:14 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50933 Shlomi,
world domination is a commendable goal.
If you add loops and user variables to your routines, I will become an enthusiastic proponent.
Then you won;t need PR funds, but you will relay on the force of the community.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50926 Tue, 06 Sep 2011 09:03:59 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50926 Giuseppe,
“This poor version is client-side, but it doesn’t require installation.”
I strive to world domination: there shall be no MySQL installation that does not include common_schema. It shall be the de facto utility schema for MySQL.

I just need to get the funds for the PR of course.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50925 Tue, 06 Sep 2011 09:00:53 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50925 Have just looked at the source code for mysql-sr-lib.
Wow! What an effort!

However this is strange. I’m quite sure a couple years back some DDL were not supported with prepared statements (e.g. DROP, ANALYZE…) and yet I see you used them.

Perhaps they were first enabled, then disabled, then re-enabled again?

]]>
By: Giuseppe Maxia https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50920 Tue, 06 Sep 2011 08:51:30 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50920 @Shlomi,
Noted. I did a server-side eval() on steroids several years ago (http://datacharmer.blogspot.com/2005/12/mysql-5-general-purpose-routine.html).
This poor version is client-side, but it doesn’t require installation.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50917 Tue, 06 Sep 2011 08:45:55 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50917 @Giuseppe,
Cool.
I think SELECT INTO OUTFILE + SOURCE are less scary. The problem with both solution is that they require interactive mysql client (SOURCE is a client command; pager is a client command).

The solution offered in eval() is entirely on the server.

]]>
By: Giuseppe Maxia https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50915 Tue, 06 Sep 2011 08:36:30 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50915 Here’s a poor man’s eval():

mysql> pager tail -n 2 | head -n 1 | tr ‘|’ ‘ ‘ | mysql -u user -pPWD

mysql> select concat(‘KILL ‘,id,’;’) from information_schema.processlist where user=’root’;

mysql> nopager

]]>
By: common_schema rev. 68: eval(), processlist_grantees, candidate_keys, easter_day() | code.openark.org https://shlomi-noach.github.io/blog/mysql/mysql-eval/comment-page-1#comment-50907 Tue, 06 Sep 2011 07:05:41 +0000 https://shlomi-noach.github.io/blog/?p=3926#comment-50907 […] MySQL eval() […]

]]>