[RDBI] redefine_def and cursor_def structures

Mateusz Loskot mateusz at loskot.net
Tue Aug 8 10:40:25 EDT 2006


Hi,

Could anyone help me to understand purpose of memebers of RDBI base
structures?

1) What's the idea behind redefine_def structure?
What are original, substitution and geometry members for?

typedef struct _mysql_redefine_def
{
    void *original;
    void *substitution;
    void *geometry; /* geometry to be deleted, since the client won't */
    int  orig_type;
} mysql_define_def;


2) I understand cursor_def as a structure representing the area of query
and its results. Am I correct?
I understand all *_count and statement members but I have troubles with
getting the idea of defines, binds, redefines and rebinds members.
Could you give me some light on these?

typedef struct _mysql_cursor_def
{
    MYSQL_STMT *statement;
    int define_count;
    MYSQL_BIND *defines;
    int bind_count;
    MYSQL_BIND *binds;
    mysql_define_def *redefines; /* array of size define_count, NULL
entries for non-geometries */
    mysql_define_def *rebinds; /* array of size bind_count, NULL entries
for non-geometries */
} mysql_cursor_def;


I tried to revealed the idea from analysing FDO source code but I'm
still not sure.
I analysed functions: adjust_defines and adjust_binds from fdordbms
sources, Src/MySQL/Driver/execute.c file.
Technically, I understand their code but I can't understand the idea in
bigger picture.

Currently, I see binds, defines, rebinds and redefines as buffers for
the same data chunks for in different representations.
For example the same geometry is stored in RDBMS-specific bytes stream
format (e.g. as BLOB chunk) and unified geometry format (OGC WKB?).
But it's still too vague for me to find out how to implement it for
PostGIS. So, I'd really appreciate some explanation.

I'm asking in terms of re-implementing those structures for PostGIS.
Thanks in advance for your help.

Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the Fdo_dev mailing list