Loading acinclude.m4 +0 −18 Original line number Diff line number Diff line Loading @@ -1599,11 +1599,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac AC_ARG_WITH([ndb-shm], [ --with-ndb-shm Include the NDB Cluster shared memory transporter], [ndb_shm="$withval"], [ndb_shm=no]) AC_ARG_WITH([ndb-test], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], Loading Loading @@ -1633,19 +1628,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) have_ndb_shm=no case "$ndb_shm" in yes ) AC_MSG_RESULT([-- including shared memory transporter]) AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) have_ndb_shm="yes" ;; * ) AC_MSG_RESULT([-- not including shared memory transporter]) ;; esac have_ndb_test=no case "$ndb_test" in yes ) Loading client/mysqldump.c +6 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; /* Set charset to the default compiled value if it hasn't been reset yet by --default-character-set=xxx. */ if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: Loading configure.in +15 −4 Original line number Diff line number Diff line Loading @@ -1923,7 +1923,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ realpath rename rint rwlock_init setupterm \ shmget shmat shmdt shmctl \ sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) Loading Loading @@ -3078,10 +3080,19 @@ fi AC_SUBST([ndb_port_base]) ndb_transporter_opt_objs="" if test X"$have_ndb_shm" = Xyes then if test "$ac_cv_func_shmget" = "yes" && test "$ac_cv_func_shmat" = "yes" && test "$ac_cv_func_shmdt" = "yes" && test "$ac_cv_func_shmctl" = "yes" then AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) AC_MSG_RESULT([Including ndb shared memory transporter]) ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" else AC_MSG_RESULT([Not including ndb shared memory transporter]) fi if test X"$have_ndb_sci" = Xyes then ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo" Loading innobase/os/os0file.c +8 −6 Original line number Diff line number Diff line Loading @@ -1850,6 +1850,7 @@ os_file_pread( return(n_bytes); #else { off_t ret_offset; ssize_t ret; ulint i; Loading @@ -1858,12 +1859,12 @@ os_file_pread( os_mutex_enter(os_file_seek_mutexes[i]); ret = lseek(file, offs, 0); ret_offset = lseek(file, offs, SEEK_SET); if (ret < 0) { if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); return(ret); return(-1); } ret = read(file, buf, (ssize_t)n); Loading Loading @@ -1936,6 +1937,7 @@ os_file_pwrite( return(ret); #else { off_t ret_offset; ulint i; /* Protect the seek / write operation with a mutex */ Loading @@ -1943,12 +1945,12 @@ os_file_pwrite( os_mutex_enter(os_file_seek_mutexes[i]); ret = lseek(file, offs, 0); ret_offset = lseek(file, offs, SEEK_SET); if (ret < 0) { if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); return(ret); return(-1); } ret = write(file, buf, (ssize_t)n); Loading libmysqld/lib_sql.cc +52 −26 Original line number Diff line number Diff line Loading @@ -591,6 +591,32 @@ int check_embedded_connection(MYSQL *mysql) C_MODE_END static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs) { uint32 dummy32; uint dummy_err; char *result; /* 'tocs' is set 0 when client issues SET character_set_results=NULL */ if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32)) { uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; result= (char *)alloc_root(root, new_len); length= copy_and_convert(result, new_len, tocs, from, length, fromcs, &dummy_err); } else { result= (char *)alloc_root(root, length + 1); memcpy(result, from, length); } result[length]= 0; return result; } bool Protocol::send_fields(List<Item> *list, uint flag) { List_iterator_fast<Item> it(*list); Loading @@ -598,6 +624,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; MEM_ROOT *field_alloc; CHARSET_INFO *thd_cs= thd->variables.character_set_results; CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("send_fields"); Loading @@ -616,12 +644,29 @@ bool Protocol::send_fields(List<Item> *list, uint flag) Send_field server_field; item->make_field(&server_field); client_field->db= strdup_root(field_alloc, server_field.db_name); client_field->table= strdup_root(field_alloc, server_field.table_name); client_field->name= strdup_root(field_alloc, server_field.col_name); client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); client_field->db= dup_str_aux(field_alloc, server_field.db_name, strlen(server_field.db_name), cs, thd_cs); client_field->table= dup_str_aux(field_alloc, server_field.table_name, strlen(server_field.table_name), cs, thd_cs); client_field->name= dup_str_aux(field_alloc, server_field.col_name, strlen(server_field.col_name), cs, thd_cs); client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, strlen(server_field.org_table_name), cs, thd_cs); client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, strlen(server_field.org_col_name), cs, thd_cs); if (item->collation.collation == &my_charset_bin || thd_cs == NULL) { /* No conversion */ client_field->charsetnr= server_field.charsetnr; client_field->length= server_field.length; } else { /* With conversion */ client_field->charsetnr= thd_cs->number; uint char_len= server_field.length / item->collation.collation->mbmaxlen; client_field->length= char_len * thd_cs->mbmaxlen; } client_field->type= server_field.type; client_field->flags= server_field.flags; client_field->decimals= server_field.decimals; Loading @@ -630,9 +675,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) client_field->name_length= strlen(client_field->name); client_field->org_name_length= strlen(client_field->org_name); client_field->org_table_length= strlen(client_field->org_table); client_field->charsetnr= server_field.charsetnr; client_field->catalog= strdup_root(field_alloc, "def"); client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs); client_field->catalog_length= 3; if (INTERNAL_NUM_FIELD(client_field)) Loading Loading @@ -805,21 +849,3 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } #if 0 /* The same as Protocol::net_store_data but does the converstion */ bool Protocol::convert_str(const char *from, uint length) { if (!(*next_field=alloc_root(alloc, length + 1))) return true; convert->store_dest(*next_field, from, length); (*next_field)[length]= 0; if (next_mysql_field->max_length < length) next_mysql_field->max_length=length; ++next_field; ++next_mysql_field; return false; } #endif Loading
acinclude.m4 +0 −18 Original line number Diff line number Diff line Loading @@ -1599,11 +1599,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac AC_ARG_WITH([ndb-shm], [ --with-ndb-shm Include the NDB Cluster shared memory transporter], [ndb_shm="$withval"], [ndb_shm=no]) AC_ARG_WITH([ndb-test], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], Loading Loading @@ -1633,19 +1628,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) have_ndb_shm=no case "$ndb_shm" in yes ) AC_MSG_RESULT([-- including shared memory transporter]) AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) have_ndb_shm="yes" ;; * ) AC_MSG_RESULT([-- not including shared memory transporter]) ;; esac have_ndb_test=no case "$ndb_test" in yes ) Loading
client/mysqldump.c +6 −0 Original line number Diff line number Diff line Loading @@ -613,6 +613,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; /* Set charset to the default compiled value if it hasn't been reset yet by --default-character-set=xxx. */ if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: Loading
configure.in +15 −4 Original line number Diff line number Diff line Loading @@ -1923,7 +1923,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ realpath rename rint rwlock_init setupterm \ shmget shmat shmdt shmctl \ sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) Loading Loading @@ -3078,10 +3080,19 @@ fi AC_SUBST([ndb_port_base]) ndb_transporter_opt_objs="" if test X"$have_ndb_shm" = Xyes then if test "$ac_cv_func_shmget" = "yes" && test "$ac_cv_func_shmat" = "yes" && test "$ac_cv_func_shmdt" = "yes" && test "$ac_cv_func_shmctl" = "yes" then AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) AC_MSG_RESULT([Including ndb shared memory transporter]) ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" else AC_MSG_RESULT([Not including ndb shared memory transporter]) fi if test X"$have_ndb_sci" = Xyes then ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo" Loading
innobase/os/os0file.c +8 −6 Original line number Diff line number Diff line Loading @@ -1850,6 +1850,7 @@ os_file_pread( return(n_bytes); #else { off_t ret_offset; ssize_t ret; ulint i; Loading @@ -1858,12 +1859,12 @@ os_file_pread( os_mutex_enter(os_file_seek_mutexes[i]); ret = lseek(file, offs, 0); ret_offset = lseek(file, offs, SEEK_SET); if (ret < 0) { if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); return(ret); return(-1); } ret = read(file, buf, (ssize_t)n); Loading Loading @@ -1936,6 +1937,7 @@ os_file_pwrite( return(ret); #else { off_t ret_offset; ulint i; /* Protect the seek / write operation with a mutex */ Loading @@ -1943,12 +1945,12 @@ os_file_pwrite( os_mutex_enter(os_file_seek_mutexes[i]); ret = lseek(file, offs, 0); ret_offset = lseek(file, offs, SEEK_SET); if (ret < 0) { if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); return(ret); return(-1); } ret = write(file, buf, (ssize_t)n); Loading
libmysqld/lib_sql.cc +52 −26 Original line number Diff line number Diff line Loading @@ -591,6 +591,32 @@ int check_embedded_connection(MYSQL *mysql) C_MODE_END static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs) { uint32 dummy32; uint dummy_err; char *result; /* 'tocs' is set 0 when client issues SET character_set_results=NULL */ if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32)) { uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; result= (char *)alloc_root(root, new_len); length= copy_and_convert(result, new_len, tocs, from, length, fromcs, &dummy_err); } else { result= (char *)alloc_root(root, length + 1); memcpy(result, from, length); } result[length]= 0; return result; } bool Protocol::send_fields(List<Item> *list, uint flag) { List_iterator_fast<Item> it(*list); Loading @@ -598,6 +624,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; MEM_ROOT *field_alloc; CHARSET_INFO *thd_cs= thd->variables.character_set_results; CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("send_fields"); Loading @@ -616,12 +644,29 @@ bool Protocol::send_fields(List<Item> *list, uint flag) Send_field server_field; item->make_field(&server_field); client_field->db= strdup_root(field_alloc, server_field.db_name); client_field->table= strdup_root(field_alloc, server_field.table_name); client_field->name= strdup_root(field_alloc, server_field.col_name); client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); client_field->db= dup_str_aux(field_alloc, server_field.db_name, strlen(server_field.db_name), cs, thd_cs); client_field->table= dup_str_aux(field_alloc, server_field.table_name, strlen(server_field.table_name), cs, thd_cs); client_field->name= dup_str_aux(field_alloc, server_field.col_name, strlen(server_field.col_name), cs, thd_cs); client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, strlen(server_field.org_table_name), cs, thd_cs); client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, strlen(server_field.org_col_name), cs, thd_cs); if (item->collation.collation == &my_charset_bin || thd_cs == NULL) { /* No conversion */ client_field->charsetnr= server_field.charsetnr; client_field->length= server_field.length; } else { /* With conversion */ client_field->charsetnr= thd_cs->number; uint char_len= server_field.length / item->collation.collation->mbmaxlen; client_field->length= char_len * thd_cs->mbmaxlen; } client_field->type= server_field.type; client_field->flags= server_field.flags; client_field->decimals= server_field.decimals; Loading @@ -630,9 +675,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag) client_field->name_length= strlen(client_field->name); client_field->org_name_length= strlen(client_field->org_name); client_field->org_table_length= strlen(client_field->org_table); client_field->charsetnr= server_field.charsetnr; client_field->catalog= strdup_root(field_alloc, "def"); client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs); client_field->catalog_length= 3; if (INTERNAL_NUM_FIELD(client_field)) Loading Loading @@ -805,21 +849,3 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } #if 0 /* The same as Protocol::net_store_data but does the converstion */ bool Protocol::convert_str(const char *from, uint length) { if (!(*next_field=alloc_root(alloc, length + 1))) return true; convert->store_dest(*next_field, from, length); (*next_field)[length]= 0; if (next_mysql_field->max_length < length) next_mysql_field->max_length=length; ++next_field; ++next_mysql_field; return false; } #endif