Im sorry if this classified as OOT

One example of the confussion

C Header File declaration of statement handler (taken from the 4.1.3)

typedef struct st_mysql_stmt
{
  MEM_ROOT       mem_root;             /* root allocations */
  LIST           list;                 /* list to keep track of all stmts */
  MYSQL          *mysql;               /* connection handle */
  MYSQL_BIND     *params;              /* input parameters */
  MYSQL_BIND     *bind;                /* output parameters */
  MYSQL_FIELD    *fields;              /* result set metadata */
  MYSQL_DATA     result;               /* cached result set */
  MYSQL_ROWS     *data_cursor;         /* current row in cached result */
                                                   /* copy of
mysql->affected_rows after statement execution */
  my_ulonglong   affected_rows;
  my_ulonglong   insert_id;            /* copy of mysql->insert_id */
  /*
    mysql_stmt_fetch() calls this function to fetch one row (it's different
    for buffered, unbuffered and cursor fetch).
  */
  int            (*read_row_func)(struct st_mysql_stmt *stmt, 
                                  unsigned char **row);
  unsigned long  stmt_id;              /* Id for prepared statement */
  unsigned int   last_errno;           /* error code */
  unsigned int   param_count;          /* inpute parameters count */
  unsigned int   field_count;          /* number of columns in result set */
  enum enum_mysql_stmt_state state;    /* statement state */
  char           last_error[MYSQL_ERRMSG_SIZE]; /* error message */
  char           sqlstate[SQLSTATE_LENGTH+1];
  /* Types of input parameters should be sent to server */
  my_bool        send_types_to_server;
  my_bool        bind_param_done;      /* input buffers were supplied */
  my_bool        bind_result_done;     /* output buffers were supplied */
  /* mysql_stmt_close() had to cancel this result */
  my_bool       unbuffered_fetch_cancelled;  
  /*
    Is set to true if we need to calculate field->max_length for 
    metadata fields when doing mysql_stmt_store_result.
  */
  my_bool       update_max_length;     
} MYSQL_STMT; 

And the pascal version (taken from Jorge del Conde's)

PMYSQL_STMT = ^TMYSQL_STMT;
  TMYSQL_STMT = record
    mysql: PMYSQL;                                  // connection handle
    params: PMYSQL_BIND;                            // input parameters
    result: PMYSQL_RES;                             // resultset
    bind: PMYSQL_BIND;                              // row binding
    fields: PMYSQL_FIELD;                           // prepare meta info
    list: _TLIST;                                    // list to keep track
of all stmts
    query: PChar;                                   // query buffer
    mem_root: TMEM_ROOT;                            // root allocations
    param_count: Cardinal;                          // parameters count
    field_count: Cardinal;                          // fields count
    stmt_id: Cardinal;                              // Id for prepared
statement
    last_errno: Cardinal;                           // error code
    state: PREP_STMT_STATE;                         // statement state
    last_error: array [0..MYSQL_ERRMSG_SIZE - 1] of char; // error message
    long_alloced: my_bool;                          // flag to indicate long
alloced
    send_types_to_server: my_bool;                  // Types sent to server
    param_buffers: my_bool;                         // param bound buffers
    res_buffers: my_bool;                           // output bound buffers
    result_buffered: my_bool;                       // Results buffered
  end;

I see that the two declarations have different number of total
field/member..
And also some of the struct/record member has different order of placement..
Is it ok for me to add the other missing member??


> -----Original Message-----
> From: Leo [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 24, 2004 9:42 AM
> To: [EMAIL PROTECTED]
> Subject: Object pascal translation of mysql header
> 
> Dear All,
> 
> Not long ago Jorge del Conde gave me his amazing translation 
> of mysql C header file to object pascal unit Including the 
> remade dll, It was able to solve my problem of migrating the 
> apps from using mysql 3.x to 4.x But now I am facing a new 
> difficulty of trying to implement mysql 4.1.3 prepared 
> statement, I already tried to edit the mysql.pas on my own, 
> adding the declaration of anything that has the word STMT on 
> the header file.. But instead it crashed my app I also do 
> some googling to find a lot of obsolote result, the mysql.pas 
> for mysql 3.X
> 
> Would some one please help me.. I never did any translation 
> from C style to pascal before Or may be Jorge can help me 
> providing the newest mysql.pas
> 
> Thanks in advance
>  
> Regards
> --
> Leonardus Setiabudi
> IT Department
> PT Bina San Prima
> Jl Tamansari 10-12
> 022-4207725 #316
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to