List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:July 7 2009 10:03pm
Subject:Re: procedure/udf access to internals
View as plain text  
Hi, Shane!

On Jul 02, Shane Adams wrote:
> Hi guys, hope this is ok to ask here.

that's what this channel is for :)
 
> Been trying to figure out if is possible to access mysql internals
> from ideally, a udf, or a procedure.   My specific goal is to provide
> a grouping() like function simliar to oracle that prints a 1 if a NULL
> was placed by the ROLLUP operation, or 0 if otherwise.  
> 
> the UDF implementation seems to hide internals, so I've pretty much
> given up on that.  The procedure code looks promising but it seems to

if you stay within the udf api - yes. But nobody prevents you from
accessing MySQL internals from within your udf.

> be executed after the query has executed so you are only provided with
> the results and my ultimate goal, accessing specifics regarding a
> rollup would of already been processed and likely not available to me.
> 
> That leaves me to believe that my last option is to somehow write
> plugin, or t patch the mysql source code directly.  Both of which are
> not trivial for someone not familiar to the code.

patching the code directly or using the udf - the complexity will be
about the same.
 
> However to start I'd be happy just printing, say all the fields used
> in the select statement.
> 
> Any pointers on where to start?

depends.

do you want a quick hack that will work for you or something that can be
accepted in MySQL source code as a contribution ?
 
Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
procedure/udf access to internalsShane Adams2 Jul 2009
  • Re: procedure/udf access to internalsSergei Golubchik7 Jul 2009