diff options
author | unknown <hf@deer.(none)> | 2003-06-17 21:32:31 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-06-17 21:32:31 +0500 |
commit | ef726bbff367ab6c5aa735655d8ff6c3fdccdb7d (patch) | |
tree | 6f68559f6a79f53926e1432aa904b9520399b6a8 /sql-common/pack.c | |
parent | 5551e0df2a5208ead3ca7d024083e572e21f8845 (diff) | |
download | mariadb-git-ef726bbff367ab6c5aa735655d8ff6c3fdccdb7d.tar.gz |
SCRUM
client capabilities included into libmysqld
some API methods became "virtual"
lots of duplicated code removed
IMHO all the above made library's code way more pleasant to look at, didn't it?
BitKeeper/deleted/.del-lib_vio.c~d779731a1e391220:
Delete: libmysqld/lib_vio.c
BitKeeper/etc/ignore:
Added libmysqld/client.c libmysqld/client_settings.h libmysqld/libmysql.c libmysqld/pack.c to the ignore list
client/mysqltest.c:
we don't need this now
include/mysql.h:
MYSQL and related structures unified
four methods made "virtual"
relative wrappers added
include/mysql_com.h:
todo added
include/mysql_embed.h:
now we include implementations of Vio structure in libmysqld
include/sql_common.h:
declarations changed
include/violite.h:
implementation of Vio included in libmysqld
libmysql/client_settings.h:
changes to make this working with both client and embedded
libmysql/libmysql.c:
global variables and my_net_local_init moved to sql-common/pack.c
libmysqld/Makefile.am:
libmysql.c, client.c, pack.c symlinked and added to sources
lib_vio.c removed
libmysqld/examples/Makefile.am:
now we need CLIENT_LIBS here
libmysqld/lib_sql.cc:
code duplications removed
emb_advanced_command was made from simple_command
libmysqld/libmysqld.c:
duplicated code removed
sql-common/client.c:
code trimmed with new model of calling
sql-common/pack.c:
some code moved here from libmysql.c and protocol.cc
sql/client_settings.h:
we don't need mysql_use_result for mini_client
sql/net_serv.cc:
file included in embedded server
sql/protocol.cc:
code moved to sql-common/pack.c
Diffstat (limited to 'sql-common/pack.c')
-rw-r--r-- | sql-common/pack.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sql-common/pack.c b/sql-common/pack.c index e363d600e20..16cc13eddbd 100644 --- a/sql-common/pack.c +++ b/sql-common/pack.c @@ -1,7 +1,28 @@ +/* Copyright (C) 2000-2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include <my_global.h> #include <mysql_com.h> #include <mysql.h> +ulong net_buffer_length=8192; +ulong max_allowed_packet= 1024L*1024L*1024L; +ulong net_read_timeout= NET_READ_TIMEOUT; +ulong net_write_timeout= NET_WRITE_TIMEOUT; + /* Get the length of next field. Change parameter to point at fieldstart */ ulong STDCALL net_field_length(uchar **packet) { @@ -62,3 +83,16 @@ my_ulonglong net_field_length_ll(uchar **packet) #endif } +/* + Functions called my my_net_init() to set some application specific variables +*/ + +void my_net_local_init(NET *net) +{ + net->max_packet= (uint) net_buffer_length; + net->read_timeout= (uint) net_read_timeout; + net->write_timeout=(uint) net_write_timeout; + net->retry_count= 1; + net->max_packet_size= max(net_buffer_length, max_allowed_packet); +} + |