MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
userInterface.h
1 /*
2  Copyright (C) 2005, 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef DBINTERFACE_H
20 #define DBINTERFACE_H
21 
22 /***************************************************************/
23 /* I N C L U D E D F I L E S */
24 /***************************************************************/
25 
26 #include "testDefinitions.h"
27 #include "testData.h"
28 
29 /***************************************************************
30 * M A C R O S *
31 ***************************************************************/
32 
33 /***************************************************************/
34 /* C O N S T A N T S */
35 /***************************************************************/
36 
37 /*-----------------------*/
38 /* Default Database Name */
39 /*-----------------------*/
40 #define DEFAULTDB "TestDbClient"
41 
42 /***************************************************************
43 * D A T A S T R U C T U R E S *
44 ***************************************************************/
45 
46 /***************************************************************
47 * P U B L I C F U N C T I O N S *
48 ***************************************************************/
49 
50 class Ndb;
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55  extern void showTime();
56  extern double userGetTime(void);
57  extern Ndb *asyncDbConnect(int parallellism);
58  extern void asyncDbDisconnect(Ndb* pNDB);
59 
60  extern void start_T1(Ndb * uh, ThreadData * data, int async);
61  extern void start_T2(Ndb * uh, ThreadData * data, int async);
62  extern void start_T3(Ndb * uh, ThreadData * data, int async);
63  extern void start_T4(Ndb * uh, ThreadData * data, int async);
64  extern void start_T5(Ndb * uh, ThreadData * data, int async);
65 
66  extern void complete_T1(ThreadData * data);
67  extern void complete_T2(ThreadData * data);
68  extern void complete_T3(ThreadData * data);
69  extern void complete_T4(ThreadData * data);
70  extern void complete_T5(ThreadData * data);
71 
72 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 
79 
80 /***************************************************************/
81 /* I N C L U D E D F I L E S */
82 /***************************************************************/
83 
84 #include "testDefinitions.h"
85 
86 /***************************************************************
87 * M A C R O S *
88 ***************************************************************/
89 
90 /***************************************************************/
91 /* C O N S T A N T S */
92 /***************************************************************/
93 
94 /*-----------------------*/
95 /* Default Database Name */
96 /*-----------------------*/
97 #define DEFAULTDB "TestDbClient"
98 
99 /***************************************************************
100 * D A T A S T R U C T U R E S *
101 ***************************************************************/
102 
103 typedef struct {
104  class Ndb_cluster_connection* pNCC;
105  class Ndb * pNDB;
106  class NdbTransaction * pCurrTrans;
107 } UserHandle;
108 
109 /***************************************************************
110 * P U B L I C F U N C T I O N S *
111 ***************************************************************/
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 
117 extern double userGetTimeSync(void);
118 
119 extern void userCheckpoint(UserHandle *uh);
120 
121 extern UserHandle *userDbConnect(uint32 createDb, const char *dbName);
122 extern void userDbDisconnect(UserHandle *uh);
123 
124 extern int userDbInsertServer(UserHandle *uh,
125  ServerId serverId,
126  SubscriberSuffix suffix,
127  ServerName name);
128 
129 extern int userDbInsertSubscriber(UserHandle *uh,
130  SubscriberNumber number,
131  uint32 groupId,
132  SubscriberName name);
133 
134 extern int userDbInsertGroup(UserHandle *uh,
135  GroupId groupId,
136  GroupName name,
137  Permission allowRead,
138  Permission allowInsert,
139  Permission allowDelete);
140 
141  extern int userDbCommit(UserHandle *uh);
142  extern int userDbRollback(UserHandle *uh);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 /***************************************************************
149 * E X T E R N A L D A T A *
150 ***************************************************************/
151 
152 #endif /* DBINTERFACE_H */
153