
The STk functions provide an almost complete interface to the C API of
MySQL. There are a few things to be aware of.


- The STk C interface only understands a limited set of C types. For
  this reason, access to some of the MySQL API functions has to go
  through simplified versions. For example, the MySQL API function
  mysql_escape_string requires the caller to pass an array with
  sufficient space for the escaped string. You can't do this directly
  from STk, so I added a function mysql_stk_escape_string which returns
  an STk string. The other two instances of this are mysql_fetch_column
  and mysql_fetch_length to get a specific column or length from a
  MYSQL_ROW or array of lengths. These are just one-liners. See the
  bottom of the file libmysqlclientstk.c

- Various small functions in the MySQL API were not actually functions,
  they were #define'd macros in <mysql/mysql.h>. I had to write
  one-liners for these too to make them available to the STk foreign
  function interface. These functions can also be found in
  libmysqlclientstk.c

- The above two points are the reason why this package comes with its
  own dynamic library.

- The STk foreign function definitions are all generated by the perl in
  extract-api.pl (called by the Makefile).

- The STk/C interface does not currently have support for the long
  long type. This may change in the near future. Until it does, you
  may run into trouble if you use the MySQL function mysql_insert_id
  to get the last value of an AUTOINDENT column (which returns a
  my_ulonglong).

  I haven't had a problem with this (because, I think, I am only using
  a long's worth of the long long and the other half of the long long
  which is being provided by MySQL is being ignored by STk (which
  defines the function as returning a long).

  If this does seem to be biting you, you might re-compile MySQL with
  NO_CLIENT_LONG_LONG defined, and MySQL will consider a my_ulonglong
  to be a ulong (see include/mysql.h in the MySQL distribution). Of
  course this probably wont help if you're accessing a table whose
  autoindent column is already bigger than a single unsigned long.
  David Fox (dsf@hci.ucsd.edu) has made some changes here to
  accomodate long longs in the STk/C interface, but they are currently
  untested. Mail me if you have problems.

- I have not dealt with the MySQL API function
  mysql_fetch_field_direct which returns a MYSQL_FIELD struct. This is
  because I never use that function and I am lazy. What's needed is a
  function (in libmysqlclientstk.c) which calls
  mysql_fetch_field_direct, puts the result in a static MYSQL_FIELD
  struct and returns a pointer to the result. Then you will need
  functions that get things out of that struct (field name, etc). It's
  not hard, it's just not done. Note that you do need the static
  struct.


