~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/handler/mysql_addons.cc

Tags: innodb-plugin-1.0.3
InnoDB Plugin 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
5
This program is free software; you can redistribute it and/or modify it under
 
6
the terms of the GNU General Public License as published by the Free Software
 
7
Foundation; version 2 of the License.
 
8
 
 
9
This program is distributed in the hope that it will be useful, but WITHOUT
 
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
12
 
 
13
You should have received a copy of the GNU General Public License along with
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
1
19
/******************************************************
2
20
This file contains functions that need to be added to
3
21
MySQL code but have not been added yet.
10
28
When MySQL commits the function it can be deleted from
11
29
here. In a perfect world this file exists but is empty.
12
30
 
13
 
(c) 2007 Innobase Oy
14
 
 
15
31
Created November 07, 2007 Vasil Dimov
16
32
*******************************************************/
17
33
 
23
39
 
24
40
#include "mysql_addons.h"
25
41
#include "univ.i"
26
 
 
27
 
/***********************************************************************
28
 
Retrieve THD::thread_id
29
 
http://bugs.mysql.com/30930 */
30
 
extern "C" UNIV_INTERN
31
 
unsigned long
32
 
ib_thd_get_thread_id(
33
 
/*=================*/
34
 
                                /* out: THD::thread_id */
35
 
        const void*     thd)    /* in: THD */
36
 
{
37
 
        return((unsigned long) ((THD*) thd)->thread_id);
38
 
}
39
 
 
40
 
/* http://bugs.mysql.com/40360 */
41
 
/* http://lists.mysql.com/commits/57450 */
42
 
/**
43
 
  See if the binary log is engaged for a thread, i.e., open and
44
 
  LOG_BIN is set.
45
 
 
46
 
  @return @c true if the binlog is active, @c false otherwise.
47
 
*/
48
 
my_bool ib_bin_log_is_engaged(const MYSQL_THD thd)
49
 
{
50
 
  return mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG);
51
 
}