1 /*
2    Copyright 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, version 2.0,
7    as published by the Free Software Foundation.
8 
9    This program is also distributed with certain software (including
10    but not limited to OpenSSL) that is licensed under separate terms,
11    as designated in a particular file or component or in included license
12    documentation.  The authors of MySQL hereby grant you an additional
13    permission to link the program and your derivative works with the
14    separately licensed software that they have included with MySQL.
15 
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License, version 2.0, for more details.
20 
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
24 
25 #ifndef DBINFO_SCAN_H
26 #define DBINFO_SCAN_H
27 
28 #include "SignalData.hpp"
29 
30 struct DbinfoScanCursor
31 {
32   Uint32 data[11];
33 };
34 
35 struct DbinfoScan
36 {
37   STATIC_CONST( SignalLength = 12 );
38 
39   // API identifiers
40   Uint32 resultData;      // Will be returned in TransIdAI::connectPtr
41   Uint32 transId[2];      // ID unique to API
42   Uint32 resultRef;       // Where to send result rows
43 
44   // Parameters for the scan
45   Uint32 tableId;         // DBINFO table ID
46   Uint32 colBitmap[2];     // bitmap of what columns you want. (64bit)
47   Uint32 requestInfo;     // flags
48   Uint32 maxRows;         // Max number of rows to return per REQ
49   Uint32 maxBytes;        // Max number of bytes to return per REQ
50 
51   // Result from the scan
52   Uint32 returnedRows;    // Number of rows returned for this CONF
53 
54   // Cursor that contains data used by the kernel for keeping track
55   // of where it is, how many bytes or rows it has sent etc.
56   // Set to zero in last CONF to indicate that scan is finished
57   Uint32 cursor_sz;
58   // Cursor data of cursor_sz size follows
59   DbinfoScanCursor cursor;
60 
getCursorPtrDbinfoScan61   static const Uint32* getCursorPtr(const DbinfoScan* sig) {
62     return sig->cursor.data;
63   }
getCursorPtrSendDbinfoScan64   static Uint32* getCursorPtrSend(DbinfoScan* sig) {
65     return sig->cursor.data;
66   }
67 
68 };
69 
70 typedef DbinfoScan DbinfoScanReq;
71 typedef DbinfoScan DbinfoScanConf;
72 
73 struct DbinfoScanRef
74 {
75   STATIC_CONST( SignalLength = 5 );
76 
77   // API identifiers
78   Uint32 resultData;      // Will be returned in TransIdAI::connectPtr
79   Uint32 transId[2];      // ID unique to API
80   Uint32 resultRef;       // Where to send result rows
81 
82   Uint32 errorCode;       // Error Code
83   enum ErrorCode
84   {
85     NoError = 0,
86     NoTable = 4800
87   };
88 };
89 
90 #endif
91