From: Brian Aker Date: May 12 2009 6:38pm Subject: Re: MySQL Reengineering Project List-Archive: http://lists.mysql.com/internals/36646 Message-Id: MIME-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi! On May 12, 2009, at 11:14 AM, Sergei Golubchik wrote: > - init() function. Brian added that to pass handlerton down. > it is ignored by any clean plugin API and should've been done > differently for storage engines and I_S tables. You should take a look at what Drizzle does as an example: static int compressionudf_plugin_init(PluginRegistry ®istry) { registry.add(&compressudf); registry.add(&uncompressudf); registry.add(&uncompressed_lengthudf); return 0; } If I remember correctly the void * was used because before the solution you had devised required that every time we updated a structure we had to update every single plugin (and the original pointer change was done by Tomas Ulin, not myself). > - MYSQL_THD is defined as void*, which is fine as it's an opaque > pointer, plugins are never expected to look inside to cast it to > anything. write_row() in the handler is another example of exposing vs encapsulation (which is fine... if you want to go with C over C++). >> Without doing this, and using encapsulation so that a THD can have >> multiple >> Statements, it will be very difficult to work on any future >> parallelization >> efforts. > > You mean, a Statement can have multiple THDs, I suppose :) No he means what he is saying. I don't know why you would want a statement shared across multiple THD, but having a THD be able to handle multiple statements means that you can do asynchronous queries within a single connection. Cheers, -Brian