mariadb/libmysqld/embedded_priv.h
unknown eadcf20081 bug #16017 (memory leaks in embedded server)
There actually was 3 different problems -
hash_user_connections wasn't cleaned
one strdupped database name wasn't freed
and stmt->mem_root wasn't cleaned as it was
replased with mysql->field_alloc for result
For the last one - i made the library using stmt's
fields to store result if it's the case.


include/mysql.h:
  statement pointer added to the advanced_command to be checked in
  embedded server
include/sql_common.h:
  stmt added to the cli_advanced_command interface
libmysql/libmysql.c:
  stmt pointer now sent to advanced_command
libmysqld/embedded_priv.h:
  it's enough to send database name to check_embedded_connection
libmysqld/lib_sql.cc:
  Now we store result directly in the MYSQL_STMT structure to
  avoid extra copying
libmysqld/libmysqld.c:
  it's enough to only send database pointer to check_embedded_connection
sql-common/client.c:
  stmt fake attribute added to cli_advanced_command
sql/sql_parse.cc:
  hash_user_connections isn't used if no access checks compiled
2006-06-01 17:06:42 +05:00

33 lines
1.3 KiB
C

/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 */
/* Prototypes for the embedded version of MySQL */
#include <my_global.h>
#include <mysql.h>
#include <mysql_embed.h>
#include <mysqld_error.h>
#include <my_pthread.h>
C_MODE_START
void lib_connection_phase(NET *net, int phase);
void init_embedded_mysql(MYSQL *mysql, int client_flag);
void *create_embedded_thd(int client_flag);
int check_embedded_connection(MYSQL *mysql, const char *db);
void free_old_query(MYSQL *mysql);
void embedded_get_error(MYSQL *mysql);
extern MYSQL_METHODS embedded_methods;
C_MODE_END