diff options
author | unknown <monty@donna.mysql.com> | 2000-09-02 07:58:42 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-09-02 07:58:42 +0300 |
commit | 40f6a9a9da1b6aeda9a850e468cb3f584caaa254 (patch) | |
tree | 28fa78a52ce90f0133e1275fabcefa57cfc8fa02 /sql | |
parent | 5a95cfdd68544f1728f7c2d3e92220bcafb7ac1a (diff) | |
download | mariadb-git-40f6a9a9da1b6aeda9a850e468cb3f584caaa254.tar.gz |
Quoting of TIMESTAMP columns and small optimizations
Build-tools/Do-compile:
Fixes for remote build
Docs/manual.texi:
Mainly updates for Access 2000
client/mysqldump.c:
Added quoting of TIMESTAMP columns
include/mysql.h:
Added quoting of TIMESTAMP columns
include/mysql_com.h:
Added quoting of TIMESTAMP columns
libmysql/libmysql.c:
Added quoting of TIMESTAMP columns
scripts/mysql_install_db.sh:
Fixed http address
sql-bench/Results/ATIS-mysql-NT_4.0:
New test results
sql-bench/Results/RUN-mysql-NT_4.0:
New test results
sql-bench/Results/alter-table-mysql-NT_4.0:
New test results
sql-bench/Results/big-tables-mysql-NT_4.0:
New test results
sql-bench/Results/connect-mysql-NT_4.0:
New test results
sql-bench/Results/create-mysql-NT_4.0:
New test results
sql-bench/Results/insert-mysql-NT_4.0:
New test results
sql-bench/Results/select-mysql-NT_4.0:
New test results
sql-bench/Results/wisconsin-mysql-NT_4.0:
New test results
sql/ChangeLog:
Changelog
sql/field.h:
Added quoting of TIMESTAMP columns
sql/mysql_priv.h:
Optimizing
sql/mysqld.cc:
Optimizing
sql/sql_class.cc:
Optimizing
sql/sql_parse.cc:
Added use of new 'localhost' variable
sql/violite.c:
Fixed print bug
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); |