diff options
author | unknown <rburnett@bk-internal.mysql.com> | 2005-05-06 15:10:01 +0200 |
---|---|---|
committer | unknown <rburnett@bk-internal.mysql.com> | 2005-05-06 15:10:01 +0200 |
commit | 6b819860e5fa83f1ba7c6025df8e227775bb1a1b (patch) | |
tree | c71943143e5639720df1bbb12f68ad2be6f17428 /sql | |
parent | 779ac9cf9e92deb2e3a9d55e3718b7f069998726 (diff) | |
parent | 9b2078d5a05e0578471b680eb79cbf4ba20c0950 (diff) | |
download | mariadb-git-6b819860e5fa83f1ba7c6025df8e227775bb1a1b.tar.gz |
Merge bk-internal.mysql.com:/data0/bk/mysql-4.1
into bk-internal.mysql.com:/users/rburnett/bug9721
BitKeeper/etc/logging_ok:
auto-union
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innodb.cc | 46 | ||||
-rw-r--r-- | sql/hostname.cc | 14 | ||||
-rw-r--r-- | sql/share/charsets/Index.xml | 22 | ||||
-rw-r--r-- | sql/share/charsets/latin2.xml | 4 |
4 files changed, 69 insertions, 17 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 0cb0f5564bf..2d2a8f2c3b4 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5183,8 +5183,12 @@ innodb_show_status( /*===============*/ THD* thd) /* in: the MySQL query thread of the caller */ { - Protocol *protocol= thd->protocol; - trx_t* trx; + Protocol* protocol = thd->protocol; + trx_t* trx; + static const char truncated_msg[] = "... truncated...\n"; + const long MAX_STATUS_SIZE = 64000; + ulint trx_list_start = ULINT_UNDEFINED; + ulint trx_list_end = ULINT_UNDEFINED; DBUG_ENTER("innodb_show_status"); @@ -5199,33 +5203,57 @@ innodb_show_status( innobase_release_stat_resources(trx); - /* We let the InnoDB Monitor to output at most 64000 bytes of text. */ + /* We let the InnoDB Monitor to output at most MAX_STATUS_SIZE + bytes of text. */ - long flen; + long flen, usable_len; char* str; mutex_enter_noninline(&srv_monitor_file_mutex); rewind(srv_monitor_file); - srv_printf_innodb_monitor(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file, + &trx_list_start, &trx_list_end); flen = ftell(srv_monitor_file); os_file_set_eof(srv_monitor_file); if (flen < 0) { flen = 0; - } else if (flen > 64000 - 1) { - flen = 64000 - 1; + } + + if (flen > MAX_STATUS_SIZE) { + usable_len = MAX_STATUS_SIZE; + } else { + usable_len = flen; } /* allocate buffer for the string, and read the contents of the temporary file */ - if (!(str = my_malloc(flen + 1, MYF(0)))) + if (!(str = my_malloc(usable_len + 1, MYF(0)))) { mutex_exit_noninline(&srv_monitor_file_mutex); DBUG_RETURN(-1); } rewind(srv_monitor_file); - flen = fread(str, 1, flen, srv_monitor_file); + if (flen < MAX_STATUS_SIZE) { + /* Display the entire output. */ + flen = fread(str, 1, flen, srv_monitor_file); + } else if (trx_list_end < (ulint) flen + && trx_list_start < trx_list_end + && trx_list_start + (flen - trx_list_end) + < MAX_STATUS_SIZE - sizeof truncated_msg - 1) { + /* Omit the beginning of the list of active transactions. */ + long len = fread(str, 1, trx_list_start, srv_monitor_file); + memcpy(str + len, truncated_msg, sizeof truncated_msg - 1); + len += sizeof truncated_msg - 1; + usable_len = (MAX_STATUS_SIZE - 1) - len; + fseek(srv_monitor_file, flen - usable_len, SEEK_SET); + len += fread(str + len, 1, usable_len, srv_monitor_file); + flen = len; + } else { + /* Omit the end of the output. */ + flen = fread(str, 1, MAX_STATUS_SIZE - 1, srv_monitor_file); + } mutex_exit_noninline(&srv_monitor_file_mutex); diff --git a/sql/hostname.cc b/sql/hostname.cc index fe2fad6f3b2..ec5c6f29a27 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -183,7 +183,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) that attempted to connect during the outage) unable to connect indefinitely. */ - if (tmp_errno == HOST_NOT_FOUND || tmp_error == NO_DATA) + if (tmp_errno == HOST_NOT_FOUND || tmp_errno == NO_DATA) add_wrong_ip(in); my_gethostbyname_r_free(); DBUG_RETURN(0); @@ -207,13 +207,17 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("gethostbyaddr returned %d",errno)); - goto err; + + if (errno == HOST_NOT_FOUND || errno == NO_DATA) + add_wrong_ip(in); /* only cache negative responses, not failures */ + + DBUG_RETURN(0); } if (!hp->h_name[0]) // Don't allow empty hostnames { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("Got an empty hostname")); - goto err; + goto add_wrong_ip_and_return; } if (!(name=my_strdup(hp->h_name,MYF(0)))) { @@ -240,7 +244,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { DBUG_PRINT("error",("mysqld doesn't accept hostnames that starts with a number followed by a '.'")); my_free(name,MYF(0)); - goto err; + goto add_wrong_ip_and_return; } } @@ -256,7 +260,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) DBUG_PRINT("error",("Couldn't verify hostname with gethostbyname")); my_free(name,MYF(0)); -err: +add_wrong_ip_and_return: add_wrong_ip(in); DBUG_RETURN(0); } diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml index 9595d4a7ddb..74763b195a8 100644 --- a/sql/share/charsets/Index.xml +++ b/sql/share/charsets/Index.xml @@ -1,6 +1,6 @@ <?xml version='1.0' encoding="utf-8"?> -<charsets max-id="94"> +<charsets max-id="96"> <copyright> Copyright (C) 2003 MySQL AB @@ -553,5 +553,25 @@ To make maintaining easier please: </collation> </charset> +<charset name="cp932"> + <family>Japanese</family> + <description>SJIS for Windows Japanese</description> + <alias>windows-31j</alias> + <alias>cswindows31j</alias> + <alias>sjisms</alias> + <alias>windows-95j</alias> + <alias>x-sjis-cp932</alias> + <alias>ms932</alias> + <alias>sjisms</alias> + <collation name="cp932_japanese_ci" id="95" order="Japanese"> + <flag>primary</flag> + <flag>compiled</flag> + </collation> + <collation name="cp932_bin" id="96" order="Binary"> + <flag>binary</flag> + <flag>compiled</flag> + </collation> +</charset> + </charsets> diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml index 702f052604b..3ae239cb8fd 100644 --- a/sql/share/charsets/latin2.xml +++ b/sql/share/charsets/latin2.xml @@ -60,7 +60,7 @@ A0 B1 A2 B3 A4 B5 B6 A7 A8 B9 BA BB BC AD BE BF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF - D0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF + F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF </map> @@ -84,7 +84,7 @@ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - F0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF + D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF </map> </upper> |