forked from Meituan-Dianping/SQLAdvisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery_strip_comments.h
More file actions
executable file
·37 lines (34 loc) · 894 Bytes
/
query_strip_comments.h
File metadata and controls
executable file
·37 lines (34 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _SQL_QUERY_STRIPC_COMMENTS_H_
#define _SQL_QUERY_STRIPC_COMMENTS_H_
#ifdef HAVE_QUERY_CACHE
// implemented in sql_cache.cc
class QueryStripComments
{
private:
QueryStripComments(const QueryStripComments&);
QueryStripComments& operator=(const QueryStripComments&);
public:
QueryStripComments();
~QueryStripComments();
void set(const char* a_query, uint a_query_length, uint a_additional_length);
char* query() { return buffer; }
uint query_length() { return length; }
private:
void cleanup();
private:
char* buffer;
uint length /*query length, not buffer length*/;
uint buffer_length;
};
class QueryStripComments_Backup
{
public:
QueryStripComments_Backup(THD* a_thd,QueryStripComments* qsc);
~QueryStripComments_Backup();
private:
THD* thd;
char* query;
uint length;
};
#endif // HAVE_QUERY_CACHE
#endif // _SQL_QUERY_STRIPC_COMMENTS_H_