-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsql_type_int.h
54 lines (47 loc) · 879 Bytes
/
sql_type_int.h
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
#ifndef SQL_TYPE_INT_H
#define SQL_TYPE_INT_H
#include <stdint.h>
typedef int32_t int32;
typedef long long longlong;
typedef unsigned long long ulonglong;
class Int32_null
{
public:
int32 value;
bool is_null;
explicit Int32_null(longlong val, bool is_null= false)
:value(val), is_null(is_null)
{ }
Int32_null()
:value(0), is_null(true)
{ }
inline Int32_null & neg()
{
value= -value;
return *this;
}
};
class Longlong_null
{
public:
longlong value;
bool is_null;
explicit Longlong_null(longlong val, bool is_null= false)
:value(val), is_null(is_null)
{ }
Longlong_null()
:value(0), is_null(true)
{ }
inline Longlong_null & neg()
{
value= -value;
return *this;
}
Longlong_null & operator+=(const Longlong_null &other)
{
value+= other.value;
is_null|= other.is_null;
return *this;
}
};
#endif