File: MysqlDefs.cs

package info (click to toggle)
mysql-connector-net 6.4.3-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,160 kB
  • ctags: 8,552
  • sloc: cs: 63,689; xml: 7,505; sql: 345; makefile: 50; ansic: 40
file content (417 lines) | stat: -rw-r--r-- 13,628 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
// Copyright (c) 2004-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
//
// MySQL Connector/NET is licensed under the terms of the GPLv2
// <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most 
// MySQL Connectors. There are special exceptions to the terms and 
// conditions of the GPLv2 as it is applied to this software, see the 
// FLOSS License Exception
// <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
//
// This program is free software; you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published 
// by the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful, but 
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
// for more details.
//
// You should have received a copy of the GNU General Public License along 
// with this program; if not, write to the Free Software Foundation, Inc., 
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA

using System;

namespace MySql.Data.MySqlClient
{
    /// <summary>
    /// Summary description for ClientParam.
    /// </summary>
    [Flags]
    internal enum ClientFlags : ulong
    {
        LONG_PASSWORD = 1, // new more secure passwords
        FOUND_ROWS = 2, // found instead of affected rows
        LONG_FLAG = 4, // Get all column flags
        CONNECT_WITH_DB = 8, // One can specify db on connect
        NO_SCHEMA = 16, // Don't allow db.table.column
        COMPRESS = 32, // Client can use compression protocol
        ODBC = 64, // ODBC client
        LOCAL_FILES = 128, // Can use LOAD DATA LOCAL
        IGNORE_SPACE = 256, // Ignore spaces before '('
        PROTOCOL_41 = 512, // Support new 4.1 protocol
        INTERACTIVE = 1024, // This is an interactive client
#if !CF
        SSL = 2048, // Switch to SSL after handshake
#endif
        IGNORE_SIGPIPE = 4096, // IGNORE sigpipes
        TRANSACTIONS = 8192, // Client knows about transactions
        RESERVED = 16384,               // old 4.1 protocol flag
        SECURE_CONNECTION = 32768,      // new 4.1 authentication
        MULTI_STATEMENTS = 65536,       // Allow multi-stmt support
        MULTI_RESULTS = 131072,         // Allow multiple resultsets
        PS_MULTI_RESULTS = 1UL << 18,    // allow multi results using PS protocol
        PLUGIN_AUTH = (1UL << 19), //Client supports plugin authentication
        CLIENT_SSL_VERIFY_SERVER_CERT= (1UL << 30),
        CLIENT_REMEMBER_OPTIONS= (1UL << 31)
    }

    [Flags]
    internal enum ServerStatusFlags
    {
        InTransaction = 1, // Transaction has started
        AutoCommitMode = 2, // Server in auto_commit mode 
        MoreResults = 4, // More results on server
        AnotherQuery = 8, // Multi query - next query exists
        BadIndex = 16,
        NoIndex = 32,
        CursorExists = 64,
        LastRowSent = 128,
        OutputParameters = 4096
    }


    /// <summary>
    /// DB Operations Code
    /// </summary>
    internal enum DBCmd : byte
    {
        SLEEP = 0,
        QUIT = 1,
        INIT_DB = 2,
        QUERY = 3,
        FIELD_LIST = 4,
        CREATE_DB = 5,
        DROP_DB = 6,
        RELOAD = 7,
        SHUTDOWN = 8,
        STATISTICS = 9,
        PROCESS_INFO = 10,
        CONNECT = 11,
        PROCESS_KILL = 12,
        DEBUG = 13,
        PING = 14,
        TIME = 15,
        DELAYED_INSERT = 16,
        CHANGE_USER = 17,
        BINLOG_DUMP = 18,
        TABLE_DUMP = 19,
        CONNECT_OUT = 20,
        REGISTER_SLAVE = 21,
        PREPARE = 22,
        EXECUTE = 23,
        LONG_DATA = 24,
        CLOSE_STMT = 25,
        RESET_STMT = 26,
        SET_OPTION = 27,
        FETCH = 28
    }


    /// <summary>
    /// Specifies MySQL specific data type of a field, property, for use in a <see cref="MySqlParameter"/>.
    /// </summary>
    public enum MySqlDbType
    {
        /// <summary>
        /// <see cref="Decimal"/>
        /// <para>A fixed precision and scale numeric value between -1038 
        /// -1 and 10 38 -1.</para>
        /// </summary>
        Decimal = 0,
        /// <summary>
        /// <see cref="Byte"/><para>The signed range is -128 to 127. The unsigned 
        /// range is 0 to 255.</para>
        /// </summary>
        Byte = 1,
        /// <summary>
        /// <see cref="Int16"/><para>A 16-bit signed integer. The signed range is 
        /// -32768 to 32767. The unsigned range is 0 to 65535</para>
        /// </summary>
        Int16 = 2,
        /// <summary>
        /// Specifies a 24 (3 byte) signed or unsigned value.
        /// </summary>
        Int24 = 9,
        /// <summary>
        /// <see cref="Int32"/><para>A 32-bit signed integer</para>
        /// </summary>
        Int32 = 3,
        /// <summary>
        /// <see cref="Int64"/><para>A 64-bit signed integer.</para>
        /// </summary>
        Int64 = 8,
        /// <summary>
        /// <see cref="Single"/><para>A small (single-precision) floating-point 
        /// number. Allowable values are -3.402823466E+38 to -1.175494351E-38, 
        /// 0, and 1.175494351E-38 to 3.402823466E+38.</para>
        /// </summary>
        Float = 4,
        /// <summary>
        /// <see cref="Double"/><para>A normal-size (double-precision) 
        /// floating-point number. Allowable values are -1.7976931348623157E+308 
        /// to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 
        /// 1.7976931348623157E+308.</para>
        /// </summary>
        Double = 5,
        /// <summary>
        /// A timestamp. The range is '1970-01-01 00:00:00' to sometime in the 
        /// year 2037
        /// </summary>
        Timestamp = 7,
        ///<summary>
        ///Date The supported range is '1000-01-01' to '9999-12-31'.
        ///</summary>
        Date = 10,
        /// <summary>
        /// Time <para>The range is '-838:59:59' to '838:59:59'.</para>
        /// </summary>
        Time = 11,
        ///<summary>
        ///DateTime The supported range is '1000-01-01 00:00:00' to 
        ///'9999-12-31 23:59:59'.
        ///</summary>
        DateTime = 12,
        ///<summary>
        ///Datetime The supported range is '1000-01-01 00:00:00' to 
        ///'9999-12-31 23:59:59'.
        ///</summary>
        [Obsolete("The Datetime enum value is obsolete.  Please use DateTime.")]
        Datetime = 12,
        /// <summary>
        /// A year in 2- or 4-digit format (default is 4-digit). The 
        /// allowable values are 1901 to 2155, 0000 in the 4-digit year 
        /// format, and 1970-2069 if you use the 2-digit format (70-69).
        /// </summary>
        Year = 13,
        /// <summary>
        /// <b>Obsolete</b>  Use Datetime or Date type
        /// </summary>
        Newdate = 14,
        /// <summary>
        /// A variable-length string containing 0 to 65535 characters
        /// </summary>
        VarString = 15,
        /// <summary>
        /// Bit-field data type
        /// </summary>
        Bit = 16,
        /// <summary>
        /// New Decimal
        /// </summary>
        NewDecimal = 246,
        /// <summary>
        /// An enumeration. A string object that can have only one value, 
        /// chosen from the list of values 'value1', 'value2', ..., NULL 
        /// or the special "" error value. An ENUM can have a maximum of 
        /// 65535 distinct values
        /// </summary>
        Enum = 247,
        /// <summary>
        /// A set. A string object that can have zero or more values, each 
        /// of which must be chosen from the list of values 'value1', 'value2', 
        /// ... A SET can have a maximum of 64 members.
        /// </summary>
        Set = 248,
        /// <summary>
        /// A binary column with a maximum length of 255 (2^8 - 1) 
        /// characters
        /// </summary>
        TinyBlob = 249,
        /// <summary>
        /// A binary column with a maximum length of 16777215 (2^24 - 1) bytes.
        /// </summary>
        MediumBlob = 250,
        /// <summary>
        /// A binary column with a maximum length of 4294967295 or 
        /// 4G (2^32 - 1) bytes.
        /// </summary>
        LongBlob = 251,
        /// <summary>
        /// A binary column with a maximum length of 65535 (2^16 - 1) bytes.
        /// </summary>
        Blob = 252,
        /// <summary>
        /// A variable-length string containing 0 to 255 bytes.
        /// </summary>
        VarChar = 253,
        /// <summary>
        /// A fixed-length string.
        /// </summary>
        String = 254,
        /// <summary>
        /// Geometric (GIS) data type.
        /// </summary>
        Geometry = 255,
        /// <summary>
        /// Unsigned 8-bit value.
        /// </summary>
        UByte = 501,
        /// <summary>
        /// Unsigned 16-bit value.
        /// </summary>
        UInt16 = 502,
        /// <summary>
        /// Unsigned 24-bit value.
        /// </summary>
        UInt24 = 509,
        /// <summary>
        /// Unsigned 32-bit value.
        /// </summary>
        UInt32 = 503,
        /// <summary>
        /// Unsigned 64-bit value.
        /// </summary>
        UInt64 = 508,
        /// <summary>
        /// Fixed length binary string.
        /// </summary>
        Binary = 600,
        /// <summary>
        /// Variable length binary string.
        /// </summary>
        VarBinary = 601,
        /// <summary>
        /// A text column with a maximum length of 255 (2^8 - 1) characters.
        /// </summary>
        TinyText = 749,
        /// <summary>
        /// A text column with a maximum length of 16777215 (2^24 - 1) characters.
        /// </summary>
        MediumText = 750,
        /// <summary>
        /// A text column with a maximum length of 4294967295 or 
        /// 4G (2^32 - 1) characters.
        /// </summary>
        LongText = 751,
        /// <summary>
        /// A text column with a maximum length of 65535 (2^16 - 1) characters.
        /// </summary>
        Text = 752,
        /// <summary>
        /// A guid column
        /// </summary>
        Guid = 800
    } ;


    internal enum Field_Type : byte
    {
        DECIMAL = 0,
        BYTE = 1,
        SHORT = 2,
        LONG = 3,
        FLOAT = 4,
        DOUBLE = 5,
        NULL = 6,
        TIMESTAMP = 7,
        LONGLONG = 8,
        INT24 = 9,
        DATE = 10,
        TIME = 11,
        DATETIME = 12,
        YEAR = 13,
        NEWDATE = 14,
        ENUM = 247,
        SET = 248,
        TINY_BLOB = 249,
        MEDIUM_BLOB = 250,
        LONG_BLOB = 251,
        BLOB = 252,
        VAR_STRING = 253,
        STRING = 254,
    }

    /// <summary>
    /// Allows the user to specify the type of connection that should
    /// be used.
    /// </summary>
    public enum MySqlConnectionProtocol
    {
        /// <summary>
        /// TCP/IP style connection.  Works everywhere.
        /// </summary>
        Sockets = 1,
        Socket = 1,
        Tcp = 1,
        /// <summary>
        /// Named pipe connection.  Works only on Windows systems.
        /// </summary>
        Pipe = 2,
        NamedPipe = 2,
        /// <summary>
        /// Unix domain socket connection.  Works only with Unix systems.
        /// </summary>
        UnixSocket = 3,
        Unix = 3,
        /// <summary>
        /// Shared memory connection.  Currently works only with Windows systems.
        /// </summary>
        SharedMemory = 4,
        Memory = 4
    }

    /// <summary>
    /// SSL options for connection.
    /// </summary>
    public enum MySqlSslMode
    {
        /// <summary>
        /// Do not use SSL.
        /// </summary>
        None,
        /// <summary>
        /// Use SSL, if server supports it.
        /// </summary>
        Preferred,
        Prefered = Preferred,
        /// <summary>
        /// Always use SSL. Deny connection if server does not support SSL.
        /// Do not perform server certificate validation. 
        /// </summary>
        Required,
        /// <summary>
        /// Always use SSL. Validate server SSL certificate, but different host name mismatch.
        /// </summary>
        VerifyCA,
        /// <summary>
        /// Always use SSL and perform full certificate validation.
        /// </summary>
        VerifyFull
    }

    /// <summary>
    /// Specifies the connection types supported
    /// </summary>
    public enum MySqlDriverType
    {
        /// <summary>
        /// Use TCP/IP sockets.
        /// </summary>
        Native,
        /// <summary>
        /// Use client library.
        /// </summary>
        Client,
        /// <summary>
        /// Use MySQL embedded server.
        /// </summary>
        Embedded
    }

    public enum MySqlCertificateStoreLocation
    {
        /// <summary>
        /// Do not use certificate store
        /// </summary>
        None,
        /// <summary>
        /// Use certificate store for the current user
        /// </summary>
        CurrentUser,
        /// <summary>
        /// User certificate store for the machine
        /// </summary>
        LocalMachine
    }
}