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