~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to sql/sp_cache.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2002 MySQL AB
 
1
/*
 
2
   Copyright (c) 2003-2008 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
 
3
   Use is subject to license terms.
2
4
 
3
5
   This program is free software; you can redistribute it and/or modify
4
6
   it under the terms of the GNU General Public License as published by
11
13
 
12
14
   You should have received a copy of the GNU General Public License
13
15
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
16
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
17
*/
15
18
 
16
19
#include "mysql_priv.h"
17
20
#ifdef USE_PRAGMA_IMPLEMENTATION
36
39
  sp_cache();
37
40
  ~sp_cache();
38
41
 
39
 
  inline void insert(sp_head *sp)
 
42
  /**
 
43
   Inserts a sp_head object into a hash table.
 
44
 
 
45
   @returns Success status
 
46
     @return TRUE Failure
 
47
     @return FALSE Success
 
48
  */
 
49
  inline bool insert(sp_head *sp)
40
50
  {
41
 
    /* TODO: why don't we check return value? */
42
 
    my_hash_insert(&m_hashtable, (const uchar *)sp);
 
51
    return my_hash_insert(&m_hashtable, (const uchar *)sp);
43
52
  }
44
53
 
45
54
  inline sp_head *lookup(char *name, uint namelen)
169
178
    sp_cache_invalidate()
170
179
      
171
180
  NOTE
172
 
    This is called when a VIEW definition is modifed. We can't destroy sp_head
173
 
    objects here as one may modify VIEW definitions from prelocking-free SPs.
 
181
    This is called when a VIEW definition is created or modified (and in some
 
182
    other contexts). We can't destroy sp_head objects here as one may modify
 
183
    VIEW definitions from prelocking-free SPs.
174
184
*/
175
185
 
176
186
void sp_cache_invalidate()