diff options
author | unknown <monty@donna.mysql.com> | 2000-09-02 08:20:54 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-09-02 08:20:54 +0300 |
commit | aaca0e3c6bd71a7b34fcb3a137ab1113a20dca1f (patch) | |
tree | 56a90e48b67792ba66ccfc2c856b09814bec0e56 /sql | |
parent | 8d0dafe3e85713cb4b0a399a699bdfc9f6434464 (diff) | |
parent | 40f6a9a9da1b6aeda9a850e468cb3f584caaa254 (diff) | |
download | mariadb-git-aaca0e3c6bd71a7b34fcb3a137ab1113a20dca1f.tar.gz |
Abort patch
Build-tools/Do-compile:
Auto merged
client/mysqldump.c:
Aborted Serges patch as this would have caused incompatibility
problems with old MySQL servers.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ChangeLog | 6 | ||||
-rw-r--r-- | sql/field.h | 2 | ||||
-rw-r--r-- | sql/mysql_priv.h | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 14 | ||||
-rw-r--r-- | sql/sql_class.cc | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 11 | ||||
-rw-r--r-- | sql/violite.c | 4 |
7 files changed, 21 insertions, 21 deletions
diff --git a/sql/ChangeLog b/sql/ChangeLog index 1dd582e2f36..fe67aca1cc0 100644 --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -1,3 +1,9 @@ +2000-09-01 Michael Widenius <monty@mysql.com> + +* Avoid allocation of "localhost" string. +* Changed that TIMESTAMP(X) is sometimes as string +* Release of 3.23.23 + 2000-08-21 Michael Widenius <monty@mysql.com> * Added RENAME TABLE. diff --git a/sql/field.h b/sql/field.h index 12a4a48562f..075e0feea96 100644 --- a/sql/field.h +++ b/sql/field.h @@ -514,7 +514,7 @@ public: Field_timestamp(char *ptr_arg, uint32 len_arg, enum utype unireg_check_arg, const char *field_name_arg, struct st_table *table_arg); - enum Item_result result_type () const { return INT_RESULT; } + enum Item_result result_type () const { return field_length == 8 || field_length == 14 ? INT_RESULT : STRING_RESULT; } enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; } void store(const char *to,uint length); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 7e372a7ffd1..a7d53b607b9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -426,7 +426,7 @@ void sql_print_error(const char *format,...) extern char mysql_data_home[2],server_version[50],max_sort_char, mysql_real_data_home[]; extern my_string mysql_unix_port,mysql_tmpdir; -extern const char *first_keyword; +extern const char *first_keyword, *localhost; extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables, created_tmp_tables, aborted_threads,aborted_connects, delayed_insert_timeout, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8ea12f68da8..35f484b0e03 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0; // replication parameters, if master_host is not NULL, we are slaving off the master my_string master_user = (char*) "test", master_password = 0, master_host=0, master_info_file = (char*) "master.info"; +const char *localhost=LOCAL_HOST; uint master_port = MYSQL_PORT, master_connect_retry = 60; ulong max_tmp_tables,max_heap_table_size; @@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) continue; } if (!(vio_tmp=vio_new(new_sock, - new_sock == unix_sock ? VIO_TYPE_SOCKET : + sock == unix_sock ? VIO_TYPE_SOCKET : VIO_TYPE_TCPIP, - new_sock == unix_sock)) || + sock == unix_sock)) || my_net_init(&thd->net,vio_tmp)) { if (vio_tmp) @@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) continue; } if (sock == unix_sock) - { - if (!(thd->host=my_strdup(LOCAL_HOST,MYF(0)))) - { - close_connection(&thd->net,ER_OUT_OF_RESOURCES); - delete thd; - continue; - } - } + thd->host=(char*) localhost; create_new_thread(thd); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f2fe6f5fe50..a310ac88421 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -150,7 +150,8 @@ THD::~THD() DBUG_PRINT("info", ("freeing host")); - safeFree(host); + if (host != localhost) // If not pointer to constant + safeFree(host); safeFree(user); safeFree(db); safeFree(ip); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3fb96857007..007e90e7ec0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -180,10 +180,7 @@ check_connections(THD *thd) #if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread) /* Fast local hostname resolve for Win32 */ if (!strcmp(thd->ip,"127.0.0.1")) - { - if (!(thd->host=my_strdup("localhost",MYF(0)))) - return (ER_OUT_OF_RESOURCES); - } + thd->host=(char*) localhost; else #endif if (!(specialflag & SPECIAL_NO_RESOLVE)) @@ -199,9 +196,9 @@ check_connections(THD *thd) if (acl_check_host(thd->host,thd->ip)) return(ER_HOST_NOT_PRIVILEGED); } - else /* No hostname means that the connection was on a socket */ + else /* Hostname given means that the connection was on a socket */ { - DBUG_PRINT("general",("Host: localhost")); + DBUG_PRINT("general",("Host: %s",thd->host)); thd->ip=0; bzero((char*) &thd->remote,sizeof(struct sockaddr)); } @@ -561,7 +558,7 @@ bool do_command(THD *thd) { packet=(char*) net->read_pos; command = (enum enum_server_command) (uchar) packet[0]; - DBUG_PRINT("general",("Command on socket %s = %d (%s)", + DBUG_PRINT("general",("Command on %s = %d (%s)", vio_description(net->vio), command, command_name[command])); } diff --git a/sql/violite.c b/sql/violite.c index 7a1424b6595..b18de053b5a 100644 --- a/sql/violite.c +++ b/sql/violite.c @@ -97,7 +97,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME)))) { vio_reset(vio, type, sd, 0, localhost); - sprintf(vio->desc, "socket (%d)", vio->sd); + sprintf(vio->desc, + (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), + vio->sd); #if !defined(___WIN__) && !defined(__EMX__) #if !defined(NO_FCNTL_NONBLOCK) vio->fcntl_mode = fcntl(sd, F_GETFL); |