userHandle.h
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:5k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /* Copyright (C) 2003 MySQL AB
  2.    This program is free software; you can redistribute it and/or modify
  3.    it under the terms of the GNU General Public License as published by
  4.    the Free Software Foundation; either version 2 of the License, or
  5.    (at your option) any later version.
  6.    This program is distributed in the hope that it will be useful,
  7.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  8.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9.    GNU General Public License for more details.
  10.    You should have received a copy of the GNU General Public License
  11.    along with this program; if not, write to the Free Software
  12.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
  13. #ifndef USERHANDLE_H
  14. #define USERHANDLE_H
  15. /***************************************************************/
  16. /* I N C L U D E D   F I L E S                                 */
  17. /***************************************************************/
  18. #include "sql.h"
  19. #include "sqlext.h"
  20. #include "sqltypes.h"
  21. #include "testDefinitions.h"
  22. /***************************************************************
  23. * M A C R O S                                                  *
  24. ***************************************************************/
  25. /***************************************************************/
  26. /* C O N S T A N T S                                           */
  27. /***************************************************************/
  28. /***************************************************************
  29. * D A T A   S T R U C T U R E S                                *
  30. ***************************************************************/
  31. struct userHandle{
  32.    SQLHENV  henv;
  33.    SQLHDBC  hdbc;
  34.    SQLHSTMT stmt;
  35.    /*----------------*/
  36.    /* Transaction T1 */
  37.    /*----------------*/
  38.    struct {
  39.       SQLHSTMT stmt;
  40.       struct {
  41.          SubscriberNumber number;
  42.          Location         location;
  43.          ChangedBy        changedBy;
  44.          ChangedTime      changedTime;
  45.       }values;
  46.    }updateSubscriber;
  47.    /*----------------*/
  48.    /* Transaction T2 */
  49.    /*----------------*/
  50.    struct {
  51.       SQLHSTMT stmt;
  52.       struct {
  53.          SubscriberNumber number;
  54.          SubscriberName   name;
  55.          Location         location;
  56.          ChangedBy        changedBy;
  57.          ChangedTime      changedTime;
  58.       }values;
  59.    }readSubscriber;
  60.    /*----------------*/
  61.    /* Transaction T3 */
  62.    /*----------------*/
  63.    struct {
  64.       SQLHSTMT stmt;
  65.       struct {
  66.          GroupId          groupId;
  67.          Permission       allowRead;
  68.       }values;
  69.    }readGroupAllowRead;
  70.    struct {
  71.       SQLHSTMT stmt;
  72.       struct {
  73.          SubscriberNumber number;
  74.          ServerId         serverId;
  75.          SessionDetails   details;
  76.       }values;
  77.    }readSessionDetails;
  78.    struct {
  79.       SQLHSTMT stmt;
  80.       struct {
  81.          ServerId         serverId;
  82.          SubscriberSuffix suffix;
  83.       }values;
  84.    }updateServerNoOfRead;
  85.    /*----------------*/
  86.    /* Transaction T4 */
  87.    /*----------------*/
  88.    struct {
  89.       SQLHSTMT stmt;
  90.       struct {
  91.          GroupId          groupId;
  92.          Permission       allowInsert;
  93.       }values;
  94.    }readGroupAllowInsert;
  95.    struct {
  96.       SQLHSTMT stmt;
  97.       struct {
  98.          SubscriberNumber number;
  99.          ServerId         serverId;
  100.          SessionDetails   details;
  101.       }values;
  102.    }insertSession;
  103.    struct {
  104.       SQLHSTMT stmt;
  105.       struct {
  106.          ServerId         serverId;
  107.          SubscriberSuffix suffix;
  108.       }values;
  109.    }updateServerNoOfInsert;
  110.    /*----------------*/
  111.    /* Transaction T5 */
  112.    /*----------------*/
  113.    struct {
  114.       SQLHSTMT stmt;
  115.       struct {
  116.          GroupId          groupId;
  117.          Permission       allowDelete;
  118.       }values;
  119.    }readGroupAllowDelete;
  120.    struct {
  121.       SQLHSTMT stmt;
  122.       struct {
  123.          SubscriberNumber number;
  124.          ServerId         serverId;
  125.       }values;
  126.    }deleteSession;
  127.    struct {
  128.       SQLHSTMT stmt;
  129.       struct {
  130.          ServerId         serverId;
  131.          SubscriberSuffix suffix;
  132.       }values;
  133.    }updateServerNoOfDelete;
  134.    /*--------------------------*/
  135.    /* Transaction T3 + T4 + T5 */
  136.    /*--------------------------*/
  137.    struct {
  138.       SQLHSTMT stmt;
  139.       struct {
  140.          SubscriberNumber number;
  141.          uint32           activeSessions;
  142.          GroupId          groupId;
  143.          ChangedBy        changedBy;
  144.          ChangedTime      changedTime;
  145.       }values;
  146.    }readSubscriberSession;
  147.    struct {
  148.       SQLHSTMT stmt;
  149.       struct {
  150.          SubscriberNumber number;
  151.          uint32           activeSessions;
  152.       }values;
  153.    }updateSubscriberSession;
  154. };
  155. /***************************************************************
  156. * P U B L I C    F U N C T I O N S                             *
  157. ***************************************************************/
  158. /***************************************************************
  159. * E X T E R N A L   D A T A                                    *
  160. ***************************************************************/
  161. #endif /* USERHANDLE_H */