Comments on: MySQL foreach() https://shlomi-noach.github.io/blog/mysql/mysql-foreach Blog by Shlomi Noach Fri, 02 Dec 2011 18:36:19 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-foreach/comment-page-1#comment-61358 Fri, 02 Dec 2011 18:36:19 +0000 https://shlomi-noach.github.io/blog/?p=4002#comment-61358 Matthew,
There’s a lot planned in terms of more sophisticated syntax like the one you suggested. Most of it is neatly organized in my brain. I’m just waiting to see if the community or user base approve of the direction I’m taking (as I’m hoping it will).
Filtering tables by engine, by format, by create options in general, by size etc. is on the roadmap.

With regard to your query (great use case!), in a month or so there’s yet a new interesting release I’m working on that’s related. The plot thickens!

]]>
By: Matthew Montgomery https://shlomi-noach.github.io/blog/mysql/mysql-foreach/comment-page-1#comment-61355 Fri, 02 Dec 2011 18:23:25 +0000 https://shlomi-noach.github.io/blog/?p=4002#comment-61355 I love it! Another great use case for this is in MySQL Cluster during on line add node. After new nodes are added, have to reorganize partition for each table to use the new nodes.

CALL foreach(‘SELECT TABLE_SCHEMA, TABLE_NAME FROM INFOMATION_SCHEMA.TABLES WHERE ENGINE=\’ndbcluster\”, ‘ALTER TABLE ${1}.${2} REORGANIZE PARTITION’);

It would be slightly nicer to have an option to

CALL foreach(‘table engine ndbcluster’, ‘ALTER TABLE ${schema}.${table} REORGANIZE PARTITION’)

But only slightly so… no worries.

]]>
By: More MySQL foreach() | code.openark.org https://shlomi-noach.github.io/blog/mysql/mysql-foreach/comment-page-1#comment-61306 Fri, 02 Dec 2011 11:42:04 +0000 https://shlomi-noach.github.io/blog/?p=4002#comment-61306 […] MySQL foreach() […]

]]>