Branch: Tag:

2006-11-17

2006-11-17 18:43:18 by Martin Stjernholm <mast@lysator.liu.se>

Added support for the charsetnr column attribute. Fixed proper recognition
of binary fields in unicode decode mode by using charsetnr instead of the
binary flag (which might be set for nonbinary columns too, e.g. "VARCHAR(17)
BINARY").

Unfortunately this means that unicode decode mode is disabled if Pike is
compiled with a client lib without support for the charsetnr attribute. That
means libs before 4.1.0.

Rev: lib/modules/Sql.pmod/mysql.pike:1.34
Rev: lib/modules/Sql.pmod/sql_util.pmod:1.16
Rev: src/modules/Mysql/acconfig.h:1.18
Rev: src/modules/Mysql/configure.in:1.54
Rev: src/modules/Mysql/mysql.c:1.107
Rev: src/modules/Mysql/result.c:1.37

1:   # - # $Id: configure.in,v 1.53 2006/08/31 10:10:18 mast Exp $ + # $Id: configure.in,v 1.54 2006/11/17 18:43:17 mast Exp $   #   # Configure script for the mysql-module   #
443:       AC_CHECK_FUNCS(ldiv open sopen close read fileno puts fgets)    +  AC_MSG_CHECKING(for the charsetnr member in MYSQL_FIELD) +  AC_CACHE_VAL(pike_cv_have_mysql_field_charsetnr, [ +  AC_TRY_LINK([ + #ifdef HAVE_WINSOCK2_H + #include <winsock2.h> + #elif defined(HAVE_WINSOCK_H) + #include <winsock.h> + #endif +  + #ifdef HAVE_MYSQL_H + #include <mysql.h> + #else + #ifdef HAVE_MYSQL_MYSQL_H + #include <mysql/mysql.h> + #else + #error Need mysql.h headerfile! + #endif + #endif +  ], [ +  void *foo__ = &(((MYSQL_FIELD *) 0)->charsetnr); +  ], [pike_cv_have_mysql_field_charsetnr="yes"], +  [pike_cv_have_mysql_field_charsetnr="no"]) +  ]) +  if test "$pike_cv_have_mysql_field_charsetnr" = yes; then +  AC_DEFINE(HAVE_MYSQL_FIELD_CHARSETNR)    fi -  +  AC_MSG_RESULT($pike_cv_have_mysql_field_charsetnr) +     fi -  + fi      AC_SUBST(MYSQL_LIBS)      AC_OUTPUT(Makefile,echo FOO >stamp-h )