Bug #31865 LEX_STRING and MYSQL_LEX_STRING mismatch
Submitted: 25 Oct 2007 22:33 Modified: 13 May 2009 8:19
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0+ OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[25 Oct 2007 22:33] Davi Arnaut
Description:
While reviewing a patch for Bug#30854, I found a discrepancy
between the definition of MYSQL_LEX_STRING and LEX_STRING:

Despite warnings in both files, the definition of LEX_STRING
in include/m_string.h is different from the definition of
MYSQL_LEX_STRING in include/mysql/plugin.h.

This is a problem because LEX_STRING uses size_t as the length
member and MYSQL_LEX_STRING uses unsigned int, resulting in
structures with different sizes and alignment (especially on
64 bit platforms).

And then we have:

include/mysql_h.ic:extern MYSQL_LEX_STRING * thd_make_lex_string(..
include/mysql/plugin.h:MYSQL_LEX_STRING *thd_make_lex_string(...
sql/sql_class.cc:LEX_STRING *thd_make_lex_string(...

How to repeat:
Not repeatable, MYSQL_LEX_STRING is currently almost unused.

Suggested fix:
Get rid of MYSQL_LEX_STRING.
[13 May 2009 8:19] Magne Mæhre
Duplicate of Bug #42461