diff options
author | monty@hundin.mysql.fi <> | 2001-12-06 14:10:51 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-12-06 14:10:51 +0200 |
commit | b658662ae4da6a9cfc83ed52d1cb9b84fcfa98ae (patch) | |
tree | 5892a4c0af05e8a0354e957498fe09243b13eebc /libmysql | |
parent | b4da2fb0ab60caad614ed5ba3705367d7004ab22 (diff) | |
download | mariadb-git-b658662ae4da6a9cfc83ed52d1cb9b84fcfa98ae.tar.gz |
Update copyright
Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/conf_to_src.c | 29 | ||||
-rw-r--r-- | libmysql/dll.c | 29 | ||||
-rw-r--r-- | libmysql/errmsg.c | 29 | ||||
-rw-r--r-- | libmysql/get_password.c | 29 | ||||
-rw-r--r-- | libmysql/libmysql.c | 55 | ||||
-rw-r--r-- | libmysql/manager.c | 41 | ||||
-rw-r--r-- | libmysql/net.c | 25 | ||||
-rw-r--r-- | libmysql/password.c | 29 |
8 files changed, 127 insertions, 139 deletions
diff --git a/libmysql/conf_to_src.c b/libmysql/conf_to_src.c index 76316638153..95ffcf1cb2b 100644 --- a/libmysql/conf_to_src.c +++ b/libmysql/conf_to_src.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* can't use -lmysys because this prog is used to create -lstrings */ diff --git a/libmysql/dll.c b/libmysql/dll.c index 5cd01e9c5df..f0a67d8f091 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* ** Handling initialization of the dll library diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 8a1069a4afb..3fdb9c0ddc6 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* Error messages for MySQL clients */ /* error messages for the daemon is in share/language/errmsg.sys */ diff --git a/libmysql/get_password.c b/libmysql/get_password.c index 4941c9b43d3..124c315a821 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* ** Ask for a password from tty diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 02921480abd..11fca745c5f 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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> #if defined(__WIN__) || defined(_WIN32) || defined(_WIN64) @@ -1055,7 +1054,7 @@ int STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, unsigned long length) { MYSQL* last_used_slave, *slave_to_use = 0; - + if ((last_used_slave = mysql->last_used_slave)) slave_to_use = last_used_slave->next_slave; else @@ -1130,7 +1129,7 @@ static inline int get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row) MYSQL* master; if (mysql_num_fields(res) < 3) return 1; /* safety */ - + /* use the same username and password as the original connection */ if (!(master = spawn_init(mysql, row[0], atoi(row[2]), 0, 0))) return 1; @@ -1148,7 +1147,7 @@ static inline int get_slaves_from_master(MYSQL* mysql) int error = 1; int has_auth_info; int port_ind; - + if (!mysql->net.vio && !mysql_real_connect(mysql,0,0,0,0,0,0,0)) { expand_error(mysql, CR_PROBE_MASTER_CONNECT); @@ -1195,7 +1194,7 @@ static inline int get_slaves_from_master(MYSQL* mysql) if (!(slave = spawn_init(mysql, row[1], atoi(row[port_ind]), tmp_user, tmp_pass))) goto err; - + /* Now add slave into the circular linked list */ slave->next_slave = mysql->next_slave; mysql->next_slave = slave; @@ -1225,7 +1224,7 @@ int STDCALL mysql_rpl_probe(MYSQL* mysql) expand_error(mysql, CR_PROBE_SLAVE_STATUS); return 1; } - + if (!(row = mysql_fetch_row(res))) goto err; @@ -1857,7 +1856,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (mysql->options.rpl_probe && mysql_rpl_probe(mysql)) goto error; - + DBUG_PRINT("exit",("Mysql handler: %lx",mysql)); reset_sigpipe(mysql); DBUG_RETURN(mysql); @@ -2017,7 +2016,7 @@ mysql_close(MYSQL *mysql) mysql->host_info=mysql->user=mysql->passwd=mysql->db=0; bzero((char*) &mysql->options,sizeof(mysql->options)); mysql->net.vio = 0; - + /* free/close slave list */ if (mysql->rpl_pivot) { @@ -2059,7 +2058,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host, MYSQL* child; if (!(child = mysql_init(0))) return 0; - + child->options.user = my_strdup((user) ? user : (parent->user ? parent->user : parent->options.user), MYF(0)); @@ -2078,7 +2077,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host, child->options.db = my_strdup(parent->options.db, MYF(0)); child->options.rpl_parse = child->options.rpl_probe = child->rpl_pivot = 0; - + return child; } @@ -2151,7 +2150,7 @@ int STDCALL mysql_read_query_result(MYSQL *mysql) could differ from the original connection if we have slaves */ mysql = mysql->last_used_con; - + if ((length = net_safe_read(mysql)) == packet_error) DBUG_RETURN(-1); free_old_query(mysql); /* Free old result */ @@ -2199,7 +2198,7 @@ mysql_real_query(MYSQL *mysql, const char *query, ulong length) DBUG_ENTER("mysql_real_query"); DBUG_PRINT("enter",("handle: %lx",mysql)); DBUG_PRINT("query",("Query = \"%s\"",query)); - + if (mysql_send_query(mysql,query,length)) DBUG_RETURN(-1); DBUG_RETURN(mysql_read_query_result(mysql)); @@ -2275,7 +2274,7 @@ mysql_store_result(MYSQL *mysql) /* read from the actually used connection */ mysql = mysql->last_used_con; - + if (!mysql->fields) DBUG_RETURN(0); if (mysql->status != MYSQL_STATUS_GET_RESULT) @@ -2330,7 +2329,7 @@ mysql_use_result(MYSQL *mysql) DBUG_ENTER("mysql_use_result"); mysql = mysql->last_used_con; - + if (!mysql->fields) DBUG_RETURN(0); if (mysql->status != MYSQL_STATUS_GET_RESULT) diff --git a/libmysql/manager.c b/libmysql/manager.c index a1262a46754..fbf0a0b2c22 100644 --- a/libmysql/manager.c +++ b/libmysql/manager.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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> #if defined(THREAD) @@ -101,7 +100,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, user="root"; if (!passwd) passwd=""; - + if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR) { con->last_errno=errno; @@ -241,14 +240,14 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, char* net_buf=(char*) con->net.read_pos, *net_buf_end; int res_buf_shift=RES_BUF_SHIFT; uint num_bytes; - + if (res_buf_size<RES_BUF_SHIFT) { con->last_errno=ENOMEM; strmov(con->last_error,"Result buffer too small"); return 1; } - + if ((num_bytes=my_net_read(&con->net)) == packet_error) { con->last_errno=errno; @@ -257,7 +256,7 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, } net_buf_end=net_buf+num_bytes; - + if ((con->eof=(net_buf[3]==' '))) res_buf_shift--; net_buf+=res_buf_shift; @@ -272,7 +271,3 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, } return 0; } - - - - diff --git a/libmysql/net.c b/libmysql/net.c index 5a39b071b4f..7eb4e0159a5 100644 --- a/libmysql/net.c +++ b/libmysql/net.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000 MySQL AB - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library 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 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 library is distributed in the hope that it will be useful, + 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 - Library General Public License for more details. + 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 Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* Write and read of logical packets to/from socket ** Writes are cached into net_buffer_length big packets. @@ -749,7 +748,7 @@ my_net_read(NET *net) for (;;) { ulong packet_len; - + if (buf_length - start_of_packet >= NET_HEADER_SIZE) { read_length = uint3korr(net->buff+start_of_packet); diff --git a/libmysql/password.c b/libmysql/password.c index cb658f32022..9b154603b98 100644 --- a/libmysql/password.c +++ b/libmysql/password.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + 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 */ /* password checking routines */ /***************************************************************************** |