2016-03-18
2016-03-18 18:04:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
2819cec1d3942ec3b1d57e80d1ace86fcae6e86b
(37 lines)
(+16/-21)
[
Show
| Annotate
]
Branch: 8.1
Sql.sql_util [Mysql]: Don't depend on the Mysql module.
This makes both MySQLUnicodeWrapper and MySQLBrokenUnicodeWrapper
always available, which fixes issues with dumped Sql.sql_util and
updating the Mysql module.
Also adds some documentation for the MySQLBrokenUnicodeWrapper.
240:
}
}
- #if constant (___Mysql.mysql.HAVE_MYSQL_FIELD_CHARSETNR)
-
+
class MySQLUnicodeWrapper
//! Result wrapper for MySQL that performs UTF-8 decoding of all
//! nonbinary fields. Useful if the result charset of the connection
267: Inside #if constant (___Mysql.mysql.HAVE_MYSQL_FIELD_CHARSETNR)
}
}
- #else
-
+
class MySQLBrokenUnicodeWrapper
- // This one is used to get a buggy unicode support when compiled with
- // an old MySQL client lib that doesn't have the charsetnr property in
- // the field info. It looks at the binary flag instead, which is set
- // for binary fields but might also be set for text fields (e.g. with
- // a definition like "VARCHAR(255) BINARY").
- //
- // I.e. the effect of using this one is that text fields with the
- // binary flag won't be correctly decoded in unicode decode mode.
- //
- // This has to be enabled either by passing "broken-unicode" as
- // charset to Sql.mysql.create or Sql.mysql.set_charset, by calling
- // Sql.mysql.set_unicode_decode_mode(-1), or by defining the
- // environment variable PIKE_BROKEN_MYSQL_UNICODE_MODE. That will
- // cause this buggy variant to be used if and only if the MySQL client
- // lib doesn't support the charsetnr property.
+ //! This one is used to get a buggy unicode support when compiled with
+ //! an old MySQL client lib that doesn't have the charsetnr property in
+ //! the field info. It looks at the binary flag instead, which is set
+ //! for binary fields but might also be set for text fields (e.g. with
+ //! a definition like @expr{"VARCHAR(255) BINARY"@}).
+ //!
+ //! I.e. the effect of using this one is that text fields with the
+ //! binary flag won't be correctly decoded in unicode decode mode.
+ //!
+ //! This has to be enabled either by passing @expr{"broken-unicode"@} as
+ //! charset to @[Sql.mysql.create] or @[Sql.mysql.set_charset], by calling
+ //! @[Sql.mysql.set_unicode_decode_mode(-1)], or by defining the
+ //! environment variable @tt{PIKE_BROKEN_MYSQL_UNICODE_MODE@}. That will
+ //! cause this buggy variant to be used if and only if the MySQL client
+ //! lib doesn't support the charsetnr property.
{
inherit UnicodeWrapper;
302:
return row;
}
}
-
- #endif
+