tag:blogger.com,1999:blog-16959946.post8488644430452999841..comments2023-12-09T16:44:47.897+01:00Comments on The Data Charmer: Multiple scripts in MySQL ProxyGiuseppe Maxiahttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-16959946.post-50512855424256816122009-01-06T16:44:00.000+01:002009-01-06T16:44:00.000+01:00I'm a coder, but a lua newb, so before I fire up a...I'm a coder, but a lua newb, so before I fire up an editor for what looks like a reasonably easy task ... Is there any reason why this technique can't be used to chain modules (rather than incurring the chained proxy costs) using something like <BR/><BR/>proxy.global.handled_functions = {<BR/> rq = {}, ...<BR/><BR/>by accumulating read_query, etc. functions and then executing them in the order in which they were specified?<BR/><BR/>With careful rewriting of modules, global namespace issues could be avoided.<BR/><BR/>I have visions of runtime tricks including using PLOAD like <BR/><BR/>PLOAD module-name;<BR/>PLOAD module-name AFTER prior-module-name;<BR/>PLOAD module-name FIRST;<BR/>PUNLOAD module-name;<BR/>PUNLOAD ALL;Anonymoushttps://www.blogger.com/profile/03677787711795535146noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-39877675895528844072007-11-22T17:01:00.000+01:002007-11-22T17:01:00.000+01:00Chaining proxies....brilliant!Thanx for clarifying...Chaining proxies....brilliant!<BR/><BR/>Thanx for clarifying, now I know when to use chained proxies vs. when I can use multiple scripts.Sheeri K. Cabralhttps://www.blogger.com/profile/13990877688502800403noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-8454274605832530722007-11-22T16:34:00.000+01:002007-11-22T16:34:00.000+01:00If your scripts do different things, you can combi...If your scripts do different things, you can combine them with this utility.<BR/>In your example, if you want to filter and log, you can load first the filtering script and then the logging one. <BR/>If you load the logging one first, and that script is logging queries and results like <A HREF="http://forge.mysql.com/snippets/view.php?id=81" REL="nofollow">this snippet</A> then the following scripts don't get a chance to be executed.<BR/>The same disappointment can happen if both scripts handle the same event. For example if you have two scripts that react to the same query ("SELECT MAGIC") and perform two different actions, the first one is always executed, while the second one gathers dust.<BR/>If this is your problem, you can't solve it with this tool, and you need to use chained proxies. Will talk about this in another article.Giuseppe Maxiahttps://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-49156475254790877872007-11-22T15:39:00.000+01:002007-11-22T15:39:00.000+01:00Hrm....this seems useful because I've been wanting...Hrm....this seems useful because I've been wanting to be able to use more than one feature, but not have one huge monolithic script.<BR/><BR/>ie, I might want to filter out a query, but also log all incoming queries, so that the filtered query gets filtered and logged. It sounds like it would be difficult to do more than one action with one query unless I actually have a monolithic script. <BR/><BR/>Or did I miss something? This definitely does help if I want to add features like crosstab and other development tricks, but less useful for administrative tricks in the aggregate.Sheeri K. Cabralhttps://www.blogger.com/profile/13990877688502800403noreply@blogger.com