Loading include/my_global.h +22 −5 Original line number Diff line number Diff line Loading @@ -121,19 +121,36 @@ #endif /* Solaris include file <sys/feature_tests.h> refers to X/Open document Solaris 9 include file <sys/feature_tests.h> refers to X/Open document System Interfaces and Headers, Issue 5 saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes, but apparently other systems (namely FreeBSD) don't agree. Furthermore X/Open has since 2004 "System Interfaces, Issue 6" that dictates _XOPEN_SOURCE=600, but Solaris checks for 500. So, let's define 500 for solaris only. On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600. Furthermore, it tests that if a program requires older standard (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be run on a new compiler (that defines _STDC_C99) and issues an #error. It's also an #error if a program requires new standard (_XOPEN_SOURCE=600 or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99. To add more to this mess, Sun Studio C compiler defines _STDC_C99 while C++ compiler does not! So, in a desperate attempt to get correct prototypes for both C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500 depending on the compiler's announced C standard support. Cleaner solutions are welcome. */ #ifdef __sun #if __STDC_VERSION__ - 0 >= 199901L #define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE 500 #endif #endif #if defined(THREAD) && !defined(__WIN__) && !defined(OS2) #ifndef _POSIX_PTHREAD_SEMANTICS Loading include/my_sys.h +2 −1 Original line number Diff line number Diff line Loading @@ -845,7 +845,8 @@ extern char *get_charsets_dir(char *buf); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length); extern void thd_increment_bytes_sent(ulong length); Loading innobase/include/trx0trx.h +3 −2 Original line number Diff line number Diff line Loading @@ -390,8 +390,9 @@ struct trx_struct{ dulint table_id; /* table id if the preceding field is TRUE */ /*------------------------------*/ int active_trans; /* whether a transaction in MySQL is active */ int active_trans; /* 1 - if a transaction in MySQL is active. 2 - if prepare_commit_mutex was taken */ void* mysql_thd; /* MySQL thread handle corresponding to this trx, or NULL */ char** mysql_query_str;/* pointer to the field in mysqld_thd Loading libmysql/libmysql.c +2 −2 Original line number Diff line number Diff line Loading @@ -1575,14 +1575,14 @@ mysql_hex_string(char *to, const char *from, ulong length) ulong STDCALL mysql_escape_string(char *to,const char *from,ulong length) { return escape_string_for_mysql(default_charset_info, to, from, length); return escape_string_for_mysql(default_charset_info, to, 0, from, length); } ulong STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) { return escape_string_for_mysql(mysql->charset, to, from, length); return escape_string_for_mysql(mysql->charset, to, 0, from, length); } Loading mysql-test/r/rpl_drop_temp.result +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ create temporary table mysqltest.t2 (n int); show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 drop database mysqltest; Loading
include/my_global.h +22 −5 Original line number Diff line number Diff line Loading @@ -121,19 +121,36 @@ #endif /* Solaris include file <sys/feature_tests.h> refers to X/Open document Solaris 9 include file <sys/feature_tests.h> refers to X/Open document System Interfaces and Headers, Issue 5 saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes, but apparently other systems (namely FreeBSD) don't agree. Furthermore X/Open has since 2004 "System Interfaces, Issue 6" that dictates _XOPEN_SOURCE=600, but Solaris checks for 500. So, let's define 500 for solaris only. On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600. Furthermore, it tests that if a program requires older standard (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be run on a new compiler (that defines _STDC_C99) and issues an #error. It's also an #error if a program requires new standard (_XOPEN_SOURCE=600 or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99. To add more to this mess, Sun Studio C compiler defines _STDC_C99 while C++ compiler does not! So, in a desperate attempt to get correct prototypes for both C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500 depending on the compiler's announced C standard support. Cleaner solutions are welcome. */ #ifdef __sun #if __STDC_VERSION__ - 0 >= 199901L #define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE 500 #endif #endif #if defined(THREAD) && !defined(__WIN__) && !defined(OS2) #ifndef _POSIX_PTHREAD_SEMANTICS Loading
include/my_sys.h +2 −1 Original line number Diff line number Diff line Loading @@ -845,7 +845,8 @@ extern char *get_charsets_dir(char *buf); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length); extern void thd_increment_bytes_sent(ulong length); Loading
innobase/include/trx0trx.h +3 −2 Original line number Diff line number Diff line Loading @@ -390,8 +390,9 @@ struct trx_struct{ dulint table_id; /* table id if the preceding field is TRUE */ /*------------------------------*/ int active_trans; /* whether a transaction in MySQL is active */ int active_trans; /* 1 - if a transaction in MySQL is active. 2 - if prepare_commit_mutex was taken */ void* mysql_thd; /* MySQL thread handle corresponding to this trx, or NULL */ char** mysql_query_str;/* pointer to the field in mysqld_thd Loading
libmysql/libmysql.c +2 −2 Original line number Diff line number Diff line Loading @@ -1575,14 +1575,14 @@ mysql_hex_string(char *to, const char *from, ulong length) ulong STDCALL mysql_escape_string(char *to,const char *from,ulong length) { return escape_string_for_mysql(default_charset_info, to, from, length); return escape_string_for_mysql(default_charset_info, to, 0, from, length); } ulong STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) { return escape_string_for_mysql(mysql->charset, to, from, length); return escape_string_for_mysql(mysql->charset, to, 0, from, length); } Loading
mysql-test/r/rpl_drop_temp.result +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ create temporary table mysqltest.t2 (n int); show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 drop database mysqltest;