Loading BUILD/compile-dist +1 −0 Original line number Diff line number Diff line Loading @@ -43,5 +43,6 @@ fi --with-berkeley-db \ --with-innodb \ --enable-thread-safe-client \ --with-extra-charsets=complex \ --with-ndbcluster make Build-tools/Do-pkg +18 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; $opt_skip_prefpane= undef; $opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; Loading @@ -41,6 +42,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", "skip-prefpane|p", "skip-dmg|skip-disk-image|s", "skip-si|skip-startup-item", "suffix=s", Loading Loading @@ -82,6 +84,7 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; $PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; Loading Loading @@ -219,6 +222,19 @@ unless ($opt_skip_si) &run_command($command, "Error while building package $SI_NAME.pkg!"); } # # Include the MySQL Preference Pane # unless ($opt_skip_prefpane) { &abort("Could not find PrefPane helper application. Did you compile and install it?") unless (-f "$PREFPANE/Contents/Resources/mahelper"); &logger("Including $PREFPANE in $PKGDEST"); &run_command("mkdir $PKGDEST/MySQL.prefPane", "Could not create $PKGDEST/MySQL.prefPane!"); &run_command("ditto $PREFPANE $PKGDEST/MySQL.prefPane", "Could not copy $PREFPANE into $PKGDEST!"); &run_command("chown -R root:wheel $PKGDEST/MySQL.prefPane", "Cannot chown $PKGDEST/MySQL.prefPane!"); } if ($opt_skip_dmg) { &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); Loading Loading @@ -254,6 +270,7 @@ chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_d &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); &run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); &run_command("chown root:wheel /Volumes/$NAME/ReadMe.txt", "Could not fix ownerships of /Volumes/$NAME/ReadMe.txt!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); Loading Loading @@ -302,6 +319,7 @@ Options: if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com -p, --skip-prefpane Skip including the PreferencePane -s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a disk image afterwards --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG Loading client/completion_hash.cc +2 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, if (!memcmp(p->arKey, arKey, nKeyLength)) { entry *n; n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)); if (!(n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)))) return FAILURE; n->pNext = p->pData; n->str = str; p->pData = n; Loading client/mysql.cc +6 −3 Original line number Diff line number Diff line Loading @@ -1502,7 +1502,10 @@ You can turn off this feature to get a quicker startup with -A\n\n"); if (!(field_names[i] = (char **) alloc_root(&hash_mem_root, sizeof(char *) * (num_fields*2+1)))) { mysql_free_result(fields); break; } field_names[i][num_fields*2]= '\0'; j=0; while ((sql_field=mysql_fetch_field(fields))) Loading Loading @@ -2077,10 +2080,10 @@ print_table_data_html(MYSQL_RES *result) } while ((cur = mysql_fetch_row(result))) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TR>", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TD>", PAGER); safe_put_field(cur[i],lengths[i]); (void) tee_fputs("</TD>", PAGER); Loading @@ -2106,10 +2109,10 @@ print_table_data_xml(MYSQL_RES *result) fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("\n <row>\n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { ulong *lengths=mysql_fetch_lengths(result); tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? (fields[i].name[0] ? fields[i].name : " ") : "NULL")); Loading client/mysqladmin.cc +34 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 char *host= NULL, *user= 0, *opt_password= 0; char *host= NULL, *user= 0, *opt_password= 0, *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; Loading Loading @@ -145,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", (gptr*) &default_charset, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, Loading Loading @@ -343,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif if (default_charset) mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); Loading Loading @@ -826,13 +832,39 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (argv[1][0]) { char *pw= argv[1]; bool old= find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD; #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') printf("Warning: single quotes were not trimmed from the password by" " your command\nline client, as you might have expected.\n"); #endif if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) /* If we don't already know to use an old-style password, see what the server is using */ if (!old) { if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) { my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; } else { MYSQL_RES *res= mysql_store_result(mysql); if (!res) { my_printf_error(0, "Could not get old_passwords setting from server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; } if (!mysql_num_rows(res)) { old= 1; } else { MYSQL_ROW row= mysql_fetch_row(res); old= !strncmp(row[1], "ON", 2); } mysql_free_result(res); } } if (old) make_scrambled_password_323(crypted_pw, pw); else make_scrambled_password(crypted_pw, pw); Loading Loading
BUILD/compile-dist +1 −0 Original line number Diff line number Diff line Loading @@ -43,5 +43,6 @@ fi --with-berkeley-db \ --with-innodb \ --enable-thread-safe-client \ --with-extra-charsets=complex \ --with-ndbcluster make
Build-tools/Do-pkg +18 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; $opt_skip_prefpane= undef; $opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; Loading @@ -41,6 +42,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", "skip-prefpane|p", "skip-dmg|skip-disk-image|s", "skip-si|skip-startup-item", "suffix=s", Loading Loading @@ -82,6 +84,7 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; $PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; Loading Loading @@ -219,6 +222,19 @@ unless ($opt_skip_si) &run_command($command, "Error while building package $SI_NAME.pkg!"); } # # Include the MySQL Preference Pane # unless ($opt_skip_prefpane) { &abort("Could not find PrefPane helper application. Did you compile and install it?") unless (-f "$PREFPANE/Contents/Resources/mahelper"); &logger("Including $PREFPANE in $PKGDEST"); &run_command("mkdir $PKGDEST/MySQL.prefPane", "Could not create $PKGDEST/MySQL.prefPane!"); &run_command("ditto $PREFPANE $PKGDEST/MySQL.prefPane", "Could not copy $PREFPANE into $PKGDEST!"); &run_command("chown -R root:wheel $PKGDEST/MySQL.prefPane", "Cannot chown $PKGDEST/MySQL.prefPane!"); } if ($opt_skip_dmg) { &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); Loading Loading @@ -254,6 +270,7 @@ chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_d &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); &run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); &run_command("chown root:wheel /Volumes/$NAME/ReadMe.txt", "Could not fix ownerships of /Volumes/$NAME/ReadMe.txt!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); Loading Loading @@ -302,6 +319,7 @@ Options: if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com -p, --skip-prefpane Skip including the PreferencePane -s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a disk image afterwards --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG Loading
client/completion_hash.cc +2 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, if (!memcmp(p->arKey, arKey, nKeyLength)) { entry *n; n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)); if (!(n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)))) return FAILURE; n->pNext = p->pData; n->str = str; p->pData = n; Loading
client/mysql.cc +6 −3 Original line number Diff line number Diff line Loading @@ -1502,7 +1502,10 @@ You can turn off this feature to get a quicker startup with -A\n\n"); if (!(field_names[i] = (char **) alloc_root(&hash_mem_root, sizeof(char *) * (num_fields*2+1)))) { mysql_free_result(fields); break; } field_names[i][num_fields*2]= '\0'; j=0; while ((sql_field=mysql_fetch_field(fields))) Loading Loading @@ -2077,10 +2080,10 @@ print_table_data_html(MYSQL_RES *result) } while ((cur = mysql_fetch_row(result))) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TR>", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TD>", PAGER); safe_put_field(cur[i],lengths[i]); (void) tee_fputs("</TD>", PAGER); Loading @@ -2106,10 +2109,10 @@ print_table_data_xml(MYSQL_RES *result) fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) { ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("\n <row>\n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { ulong *lengths=mysql_fetch_lengths(result); tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? (fields[i].name[0] ? fields[i].name : " ") : "NULL")); Loading
client/mysqladmin.cc +34 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 char *host= NULL, *user= 0, *opt_password= 0; char *host= NULL, *user= 0, *opt_password= 0, *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; Loading Loading @@ -145,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", (gptr*) &default_charset, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, Loading Loading @@ -343,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif if (default_charset) mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); Loading Loading @@ -826,13 +832,39 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (argv[1][0]) { char *pw= argv[1]; bool old= find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD; #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') printf("Warning: single quotes were not trimmed from the password by" " your command\nline client, as you might have expected.\n"); #endif if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) /* If we don't already know to use an old-style password, see what the server is using */ if (!old) { if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) { my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; } else { MYSQL_RES *res= mysql_store_result(mysql); if (!res) { my_printf_error(0, "Could not get old_passwords setting from server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; } if (!mysql_num_rows(res)) { old= 1; } else { MYSQL_ROW row= mysql_fetch_row(res); old= !strncmp(row[1], "ON", 2); } mysql_free_result(res); } } if (old) make_scrambled_password_323(crypted_pw, pw); else make_scrambled_password(crypted_pw, pw); Loading