Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4b328dbd
Commit
4b328dbd
authored
Feb 16, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-wl2278
parents
a3a1d50a
338f75a4
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
269 additions
and
60 deletions
+269
-60
include/config-win.h
include/config-win.h
+15
-8
mysql-test/r/ndb_index_ordered.result
mysql-test/r/ndb_index_ordered.result
+83
-0
mysql-test/t/ndb_index_ordered.test
mysql-test/t/ndb_index_ordered.test
+48
-48
ndb/include/kernel/signaldata/DictTabInfo.hpp
ndb/include/kernel/signaldata/DictTabInfo.hpp
+37
-0
ndb/include/ndb_constants.h
ndb/include/ndb_constants.h
+3
-1
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+2
-0
ndb/include/util/NdbSqlUtil.hpp
ndb/include/util/NdbSqlUtil.hpp
+5
-1
ndb/src/common/util/NdbSqlUtil.cpp
ndb/src/common/util/NdbSqlUtil.cpp
+36
-0
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+6
-0
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+2
-0
ndb/src/ndbapi/NdbRecAttr.cpp
ndb/src/ndbapi/NdbRecAttr.cpp
+5
-0
ndb/test/include/NdbSchemaOp.hpp
ndb/test/include/NdbSchemaOp.hpp
+2
-0
ndb/test/src/HugoCalculator.cpp
ndb/test/src/HugoCalculator.cpp
+2
-0
ndb/tools/restore/consumer.cpp
ndb/tools/restore/consumer.cpp
+2
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+1
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+20
-1
No files found.
include/config-win.h
View file @
4b328dbd
...
@@ -31,18 +31,25 @@ functions */
...
@@ -31,18 +31,25 @@ functions */
#define HAVE_SMEM 1
#define HAVE_SMEM 1
#if defined(_
_NT__)
#if defined(_
WIN64) || defined(WIN64)
#define SYSTEM_TYPE "
NT"
#define SYSTEM_TYPE "
Win64"
#elif defined(_
_WIN2000__)
#elif defined(_
WIN32) || defined(WIN32)
#define SYSTEM_TYPE "W
IN2000"
#define SYSTEM_TYPE "W
in32"
#else
#else
#define SYSTEM_TYPE "Win
95/Win98
"
#define SYSTEM_TYPE "Win
dows
"
#endif
#endif
#if defined(_WIN64) || defined(WIN64)
#if defined(_M_IA64)
#define MACHINE_TYPE "ia64"
/* Define to machine type name */
#define MACHINE_TYPE "ia64"
#elif defined(_M_IX86)
#define MACHINE_TYPE "ia32"
#elif defined(_M_ALPHA)
#define MACHINE_TYPE "axp"
#else
#else
#define MACHINE_TYPE "i32"
/* Define to machine type name */
#define MACHINE_TYPE "unknown"
/* Define to machine type name */
#endif
#if !(defined(_WIN64) || defined(WIN64))
#ifndef _WIN32
#ifndef _WIN32
#define _WIN32
/* Compatible with old source */
#define _WIN32
/* Compatible with old source */
#endif
#endif
...
...
mysql-test/r/ndb_index_ordered.result
View file @
4b328dbd
...
@@ -554,6 +554,89 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
...
@@ -554,6 +554,89 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
count(*)-9
count(*)-9
0
0
drop table t1;
drop table t1;
create table t1 (
a int primary key,
s decimal(12),
t decimal(12, 5),
u decimal(12) unsigned,
v decimal(12, 5) unsigned,
key (s),
key (t),
key (u),
key (v)
) engine=ndb;
insert into t1 values
( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
select count(*)- 5 from t1 use index (s) where s < -000000000007;
count(*)- 5
0
select count(*)- 7 from t1 use index (s) where s <= -000000000007;
count(*)- 7
0
select count(*)- 2 from t1 use index (s) where s = -000000000007;
count(*)- 2
0
select count(*)- 5 from t1 use index (s) where s >= -000000000007;
count(*)- 5
0
select count(*)- 3 from t1 use index (s) where s > -000000000007;
count(*)- 3
0
select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
count(*)- 4
0
select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
count(*)- 5
0
select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
count(*)- 1
0
select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
count(*)- 6
0
select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
count(*)- 5
0
select count(*)- 2 from t1 use index (u) where u < 000000000061;
count(*)- 2
0
select count(*)- 4 from t1 use index (u) where u <= 000000000061;
count(*)- 4
0
select count(*)- 2 from t1 use index (u) where u = 000000000061;
count(*)- 2
0
select count(*)- 8 from t1 use index (u) where u >= 000000000061;
count(*)- 8
0
select count(*)- 6 from t1 use index (u) where u > 000000000061;
count(*)- 6
0
select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
count(*)- 5
0
select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
count(*)- 6
0
select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
count(*)- 1
0
select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
count(*)- 5
0
select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
count(*)- 4
0
drop table t1;
create table t1(a int primary key, b int not null, index(b));
create table t1(a int primary key, b int not null, index(b));
insert into t1 values (1,1), (2,2);
insert into t1 values (1,1), (2,2);
set autocommit=0;
set autocommit=0;
...
...
mysql-test/t/ndb_index_ordered.test
View file @
4b328dbd
...
@@ -282,55 +282,55 @@ drop table t1;
...
@@ -282,55 +282,55 @@ drop table t1;
# decimal (not the new 5.0 thing)
# decimal (not the new 5.0 thing)
#create table t1 (
create
table
t1
(
# a int primary key,
a
int
primary
key
,
# s decimal(12),
s
decimal
(
12
),
# t decimal(12, 5),
t
decimal
(
12
,
5
),
# u decimal(12) unsigned,
u
decimal
(
12
)
unsigned
,
# v decimal(12, 5) unsigned,
v
decimal
(
12
,
5
)
unsigned
,
# key (s),
key
(
s
),
# key (t),
key
(
t
),
# key (u),
key
(
u
),
# key (v)
key
(
v
)
#) engine=ndb;
)
engine
=
ndb
;
##
#
#insert into t1 values
insert
into
t1
values
# ( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
(
0
,
-
000000000007
,
-
0000061.00003
,
000000000061
,
0000965.00042
),
# ( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
(
1
,
-
000000000007
,
-
0000061.00042
,
000000000061
,
0000965.00003
),
# ( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
(
2
,
-
071006035767
,
4210253.00024
,
000000000001
,
0000001.84488
),
# ( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
(
3
,
000000007115
,
0000000.77607
,
000077350625
,
0000018.00013
),
# ( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
(
4
,
-
00000006
8391
,
-
0346486.00000
,
000000005071
,
0005334.00002
),
# ( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
(
5
,
-
521579890459
,
-
1936874.00001
,
000000000154
,
0000003.00018
),
# ( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
(
6
,
-
521579890459
,
-
1936874.00018
,
000000000154
,
0000003.00001
),
# ( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
(
7
,
000000000333
,
0000051.39140
,
000000
907958
,
0788643.08374
),
# ( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
(
8
,
00004273122
9
,
0000009.00000
,
00000000000
9
,
6428667.00000
),
# ( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
(
9
,
-
00000
8159769
,
0000918.00004
,
0000
96951421
,
7607730.00008
);
##
#
#select count(*)- 5 from t1 use index (s) where s < -000000000007;
select
count
(
*
)
-
5
from
t1
use
index
(s) where s < -000000000007
;
#select count(*)- 7 from t1 use index (s) where s <= -000000000007;
select
count
(
*
)
-
7
from
t1
use
index
(s) where s <= -000000000007
;
#select count(*)- 2 from t1 use index (s) where s = -000000000007;
select
count
(
*
)
-
2
from
t1
use
index
(s) where s = -000000000007
;
#select count(*)- 5 from t1 use index (s) where s >= -000000000007;
select
count
(
*
)
-
5
from
t1
use
index
(s) where s >= -000000000007
;
#select count(*)- 3 from t1 use index (s) where s > -000000000007;
select
count
(
*
)
-
3
from
t1
use
index
(s) where s > -000000000007
;
##
#select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
#select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
#select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
#select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
#select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
##
#select count(*)- 2 from t1 use index (u) where u < 000000000061;
#select count(*)- 4 from t1 use index (u) where u <= 000000000061;
#select count(*)- 2 from t1 use index (u) where u = 000000000061;
#select count(*)- 8 from t1 use index (u) where u >= 000000000061;
#select count(*)- 6 from t1 use index (u) where u > 000000000061;
##
#select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
#select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
#select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
#select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
#select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
#
#
#drop table t1;
select
count
(
*
)
-
4
from
t1
use
index
(t) where t < -0000061.00003
;
select
count
(
*
)
-
5
from
t1
use
index
(t) where t <= -0000061.00003
;
select
count
(
*
)
-
1
from
t1
use
index
(t) where t = -0000061.00003
;
select
count
(
*
)
-
6
from
t1
use
index
(t) where t >= -0000061.00003
;
select
count
(
*
)
-
5
from
t1
use
index
(t) where t > -0000061.00003
;
#
select
count
(
*
)
-
2
from
t1
use
index
(u) where u < 000000000061
;
select
count
(
*
)
-
4
from
t1
use
index
(u) where u <= 000000000061
;
select
count
(
*
)
-
2
from
t1
use
index
(u) where u = 000000000061
;
select
count
(
*
)
-
8
from
t1
use
index
(u) where u >= 000000000061
;
select
count
(
*
)
-
6
from
t1
use
index
(u) where u > 000000000061
;
#
select
count
(
*
)
-
5
from
t1
use
index
(v) where v < 0000965.00042
;
select
count
(
*
)
-
6
from
t1
use
index
(v) where v <= 0000965.00042
;
select
count
(
*
)
-
1
from
t1
use
index
(v) where v = 0000965.00042
;
select
count
(
*
)
-
5
from
t1
use
index
(v) where v >= 0000965.00042
;
select
count
(
*
)
-
4
from
t1
use
index
(v) where v > 0000965.00042
;
drop
table
t1
;
# bug#7798
# bug#7798
create
table
t1
(
a
int
primary
key
,
b
int
not
null
,
index
(
b
));
create
table
t1
(
a
int
primary
key
,
b
int
not
null
,
index
(
b
));
...
...
ndb/include/kernel/signaldata/DictTabInfo.hpp
View file @
4b328dbd
...
@@ -24,6 +24,28 @@
...
@@ -24,6 +24,28 @@
#include <trigger_definitions.h>
#include <trigger_definitions.h>
#include <NdbSqlUtil.hpp>
#include <NdbSqlUtil.hpp>
#ifndef my_decimal_h
// sql/my_decimal.h requires many more sql/*.h new to ndb
// for now, copy the bit we need TODO proper fix
#define DECIMAL_MAX_LENGTH ((8 * 9) - 8)
#ifndef NOT_FIXED_DEC
#define NOT_FIXED_DEC 31
#endif
C_MODE_START
extern
int
decimal_bin_size
(
int
,
int
);
C_MODE_END
inline
int
my_decimal_get_binary_size
(
uint
precision
,
uint
scale
)
{
return
decimal_bin_size
((
int
)
precision
,
(
int
)
scale
);
}
#endif
#define DTIMAP(x, y, z) \
#define DTIMAP(x, y, z) \
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
...
@@ -266,6 +288,8 @@ public:
...
@@ -266,6 +288,8 @@ public:
ExtDouble
=
NdbSqlUtil
::
Type
::
Double
,
ExtDouble
=
NdbSqlUtil
::
Type
::
Double
,
ExtOlddecimal
=
NdbSqlUtil
::
Type
::
Olddecimal
,
ExtOlddecimal
=
NdbSqlUtil
::
Type
::
Olddecimal
,
ExtOlddecimalunsigned
=
NdbSqlUtil
::
Type
::
Olddecimalunsigned
,
ExtOlddecimalunsigned
=
NdbSqlUtil
::
Type
::
Olddecimalunsigned
,
ExtDecimal
=
NdbSqlUtil
::
Type
::
Decimal
,
ExtDecimalunsigned
=
NdbSqlUtil
::
Type
::
Decimalunsigned
,
ExtChar
=
NdbSqlUtil
::
Type
::
Char
,
ExtChar
=
NdbSqlUtil
::
Type
::
Char
,
ExtVarchar
=
NdbSqlUtil
::
Type
::
Varchar
,
ExtVarchar
=
NdbSqlUtil
::
Type
::
Varchar
,
ExtBinary
=
NdbSqlUtil
::
Type
::
Binary
,
ExtBinary
=
NdbSqlUtil
::
Type
::
Binary
,
...
@@ -358,6 +382,19 @@ public:
...
@@ -358,6 +382,19 @@ public:
(
0
+
AttributeExtPrecision
+
(
int
(
AttributeExtScale
)
>
0
))
*
(
0
+
AttributeExtPrecision
+
(
int
(
AttributeExtScale
)
>
0
))
*
AttributeExtLength
;
AttributeExtLength
;
break
;
break
;
case
DictTabInfo
:
:
ExtDecimal
:
case
DictTabInfo
:
:
ExtDecimalunsigned
:
{
// copy from Field_new_decimal ctor
uint
precision
=
AttributeExtPrecision
;
uint
scale
=
AttributeExtScale
;
if
(
precision
>
DECIMAL_MAX_LENGTH
||
scale
>=
NOT_FIXED_DEC
)
precision
=
DECIMAL_MAX_LENGTH
;
uint
bin_size
=
my_decimal_get_binary_size
(
precision
,
scale
);
AttributeSize
=
DictTabInfo
::
an8Bit
;
AttributeArraySize
=
bin_size
*
AttributeExtLength
;
}
break
;
case
DictTabInfo
:
:
ExtChar
:
case
DictTabInfo
:
:
ExtChar
:
case
DictTabInfo
:
:
ExtBinary
:
case
DictTabInfo
:
:
ExtBinary
:
AttributeSize
=
DictTabInfo
::
an8Bit
;
AttributeSize
=
DictTabInfo
::
an8Bit
;
...
...
ndb/include/ndb_constants.h
View file @
4b328dbd
...
@@ -64,7 +64,9 @@
...
@@ -64,7 +64,9 @@
#define NDB_TYPE_YEAR 26
#define NDB_TYPE_YEAR 26
#define NDB_TYPE_TIMESTAMP 27
#define NDB_TYPE_TIMESTAMP 27
#define NDB_TYPE_OLDDECIMALUNSIGNED 28
#define NDB_TYPE_OLDDECIMALUNSIGNED 28
#define NDB_TYPE_DECIMAL 29
#define NDB_TYPE_DECIMALUNSIGNED 30
#define NDB_TYPE_MAX
29
#define NDB_TYPE_MAX
31
#endif
#endif
ndb/include/ndbapi/NdbDictionary.hpp
View file @
4b328dbd
...
@@ -186,6 +186,8 @@ public:
...
@@ -186,6 +186,8 @@ public:
Double
=
NDB_TYPE_DOUBLE
,
///< 64-bit float. 8 byte float, can be used in array
Double
=
NDB_TYPE_DOUBLE
,
///< 64-bit float. 8 byte float, can be used in array
Olddecimal
=
NDB_TYPE_OLDDECIMAL
,
///< MySQL < 5.0 signed decimal, Precision, Scale
Olddecimal
=
NDB_TYPE_OLDDECIMAL
,
///< MySQL < 5.0 signed decimal, Precision, Scale
Olddecimalunsigned
=
NDB_TYPE_OLDDECIMALUNSIGNED
,
Olddecimalunsigned
=
NDB_TYPE_OLDDECIMALUNSIGNED
,
Decimal
=
NDB_TYPE_DECIMAL
,
///< MySQL >= 5.0 signed decimal, Precision, Scale
Decimalunsigned
=
NDB_TYPE_DECIMALUNSIGNED
,
Char
=
NDB_TYPE_CHAR
,
///< Len. A fixed array of 1-byte chars
Char
=
NDB_TYPE_CHAR
,
///< Len. A fixed array of 1-byte chars
Varchar
=
NDB_TYPE_VARCHAR
,
///< Length bytes: 1, Max: 255
Varchar
=
NDB_TYPE_VARCHAR
,
///< Length bytes: 1, Max: 255
Binary
=
NDB_TYPE_BINARY
,
///< Len
Binary
=
NDB_TYPE_BINARY
,
///< Len
...
...
ndb/include/util/NdbSqlUtil.hpp
View file @
4b328dbd
...
@@ -95,7 +95,9 @@ public:
...
@@ -95,7 +95,9 @@ public:
Time
=
NDB_TYPE_TIME
,
Time
=
NDB_TYPE_TIME
,
Year
=
NDB_TYPE_YEAR
,
Year
=
NDB_TYPE_YEAR
,
Timestamp
=
NDB_TYPE_TIMESTAMP
,
Timestamp
=
NDB_TYPE_TIMESTAMP
,
Olddecimalunsigned
=
NDB_TYPE_OLDDECIMALUNSIGNED
Olddecimalunsigned
=
NDB_TYPE_OLDDECIMALUNSIGNED
,
Decimal
=
NDB_TYPE_DECIMAL
,
Decimalunsigned
=
NDB_TYPE_DECIMALUNSIGNED
};
};
Enum
m_typeId
;
// redundant
Enum
m_typeId
;
// redundant
Cmp
*
m_cmp
;
// comparison method
Cmp
*
m_cmp
;
// comparison method
...
@@ -172,6 +174,8 @@ private:
...
@@ -172,6 +174,8 @@ private:
static
Cmp
cmpYear
;
static
Cmp
cmpYear
;
static
Cmp
cmpTimestamp
;
static
Cmp
cmpTimestamp
;
static
Cmp
cmpOlddecimalunsigned
;
static
Cmp
cmpOlddecimalunsigned
;
static
Cmp
cmpDecimal
;
static
Cmp
cmpDecimalunsigned
;
};
};
#endif
#endif
ndb/src/common/util/NdbSqlUtil.cpp
View file @
4b328dbd
...
@@ -192,6 +192,14 @@ NdbSqlUtil::m_typeList[] = {
...
@@ -192,6 +192,14 @@ NdbSqlUtil::m_typeList[] = {
{
// 28
{
// 28
Type
::
Olddecimalunsigned
,
Type
::
Olddecimalunsigned
,
cmpOlddecimalunsigned
cmpOlddecimalunsigned
},
{
// 29
Type
::
Decimal
,
cmpDecimal
},
{
// 30
Type
::
Decimalunsigned
,
cmpDecimalunsigned
}
}
};
};
...
@@ -483,6 +491,34 @@ NdbSqlUtil::cmpOlddecimalunsigned(const void* info, const void* p1, unsigned n1,
...
@@ -483,6 +491,34 @@ NdbSqlUtil::cmpOlddecimalunsigned(const void* info, const void* p1, unsigned n1,
return
CmpUnknown
;
return
CmpUnknown
;
}
}
int
NdbSqlUtil
::
cmpDecimal
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
// compare as binary strings
unsigned
n
=
(
n1
<=
n2
?
n1
:
n2
);
int
k
=
memcmp
(
v1
,
v2
,
n
);
if
(
k
==
0
)
{
k
=
(
full
?
n1
:
n
)
-
n2
;
}
return
k
<
0
?
-
1
:
k
>
0
?
+
1
:
full
?
0
:
CmpUnknown
;
}
int
NdbSqlUtil
::
cmpDecimalunsigned
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
// compare as binary strings
unsigned
n
=
(
n1
<=
n2
?
n1
:
n2
);
int
k
=
memcmp
(
v1
,
v2
,
n
);
if
(
k
==
0
)
{
k
=
(
full
?
n1
:
n
)
-
n2
;
}
return
k
<
0
?
-
1
:
k
>
0
?
+
1
:
full
?
0
:
CmpUnknown
;
}
int
int
NdbSqlUtil
::
cmpChar
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
NdbSqlUtil
::
cmpChar
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
{
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
4b328dbd
...
@@ -954,6 +954,12 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
...
@@ -954,6 +954,12 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
out
<<
"Olddecimalunsigned("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
out
<<
"Olddecimalunsigned("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
out
<<
"Decimal("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
out
<<
"Decimalunsigned("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Char
:
out
<<
"Char("
<<
col
.
getLength
()
<<
";"
<<
csname
<<
")"
;
out
<<
"Char("
<<
col
.
getLength
()
<<
";"
<<
csname
<<
")"
;
break
;
break
;
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
4b328dbd
...
@@ -111,6 +111,8 @@ NdbColumnImpl::init(Type t)
...
@@ -111,6 +111,8 @@ NdbColumnImpl::init(Type t)
break
;
break
;
case
Olddecimal
:
case
Olddecimal
:
case
Olddecimalunsigned
:
case
Olddecimalunsigned
:
case
Decimal
:
case
Decimalunsigned
:
m_precision
=
10
;
m_precision
=
10
;
m_scale
=
0
;
m_scale
=
0
;
m_length
=
1
;
m_length
=
1
;
...
...
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
4b328dbd
...
@@ -250,6 +250,10 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
...
@@ -250,6 +250,10 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
}
break
;
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
goto
unknown
;
// TODO
break
;
// for dates cut-and-paste from field.cc
// for dates cut-and-paste from field.cc
case
NdbDictionary
:
:
Column
::
Datetime
:
case
NdbDictionary
:
:
Column
::
Datetime
:
{
{
...
@@ -359,6 +363,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
...
@@ -359,6 +363,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
j
=
length
;
j
=
length
;
}
}
break
;
break
;
unknown:
default:
/* no print functions for the rest, just print type */
default:
/* no print functions for the rest, just print type */
out
<<
(
int
)
r
.
getType
();
out
<<
(
int
)
r
.
getType
();
j
=
length
;
j
=
length
;
...
...
ndb/test/include/NdbSchemaOp.hpp
View file @
4b328dbd
...
@@ -569,6 +569,8 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type)
...
@@ -569,6 +569,8 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type)
case
NdbDictionary
:
:
Column
::
Float
:
case
NdbDictionary
:
:
Column
::
Float
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
case
NdbDictionary
:
:
Column
::
Double
:
case
NdbDictionary
:
:
Column
::
Double
:
return
Float
;
return
Float
;
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Char
:
...
...
ndb/test/src/HugoCalculator.cpp
View file @
4b328dbd
...
@@ -147,6 +147,8 @@ HugoCalculator::calcValue(int record,
...
@@ -147,6 +147,8 @@ HugoCalculator::calcValue(int record,
case
NdbDictionary
:
:
Column
::
Double
:
case
NdbDictionary
:
:
Column
::
Double
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
case
NdbDictionary
:
:
Column
::
Binary
:
case
NdbDictionary
:
:
Column
::
Binary
:
case
NdbDictionary
:
:
Column
::
Datetime
:
case
NdbDictionary
:
:
Column
::
Datetime
:
case
NdbDictionary
:
:
Column
::
Time
:
case
NdbDictionary
:
:
Column
::
Time
:
...
...
ndb/tools/restore/consumer.cpp
View file @
4b328dbd
...
@@ -45,9 +45,11 @@ BackupConsumer::create_table_string(const TableS & table,
...
@@ -45,9 +45,11 @@ BackupConsumer::create_table_string(const TableS & table,
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"float"
);
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"float"
);
break
;
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Decimal
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal"
);
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal"
);
break
;
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal unsigned"
);
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal unsigned"
);
break
;
break
;
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Char
:
...
...
sql/ha_innodb.cc
View file @
4b328dbd
...
@@ -602,7 +602,7 @@ innobase_mysql_tmpfile(void)
...
@@ -602,7 +602,7 @@ innobase_mysql_tmpfile(void)
{
{
char
filename
[
FN_REFLEN
];
char
filename
[
FN_REFLEN
];
int
fd2
=
-
1
;
int
fd2
=
-
1
;
File
fd
=
create_temp_file
(
filename
,
NullS
,
"ib"
,
File
fd
=
create_temp_file
(
filename
,
mysql_tmpdir
,
"ib"
,
#ifdef __WIN__
#ifdef __WIN__
O_BINARY
|
O_TRUNC
|
O_SEQUENTIAL
|
O_BINARY
|
O_TRUNC
|
O_SEQUENTIAL
|
O_TEMPORARY
|
O_SHORT_LIVED
|
O_TEMPORARY
|
O_SHORT_LIVED
|
...
...
sql/ha_ndbcluster.cc
View file @
4b328dbd
...
@@ -446,7 +446,6 @@ bool ha_ndbcluster::get_error_message(int error,
...
@@ -446,7 +446,6 @@ bool ha_ndbcluster::get_error_message(int error,
static
inline
bool
ndb_supported_type
(
enum_field_types
type
)
static
inline
bool
ndb_supported_type
(
enum_field_types
type
)
{
{
switch
(
type
)
{
switch
(
type
)
{
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_LONG
:
case
MYSQL_TYPE_LONG
:
...
@@ -454,6 +453,8 @@ static inline bool ndb_supported_type(enum_field_types type)
...
@@ -454,6 +453,8 @@ static inline bool ndb_supported_type(enum_field_types type)
case
MYSQL_TYPE_LONGLONG
:
case
MYSQL_TYPE_LONGLONG
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_DOUBLE
:
case
MYSQL_TYPE_DOUBLE
:
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_TIMESTAMP
:
case
MYSQL_TYPE_TIMESTAMP
:
case
MYSQL_TYPE_DATETIME
:
case
MYSQL_TYPE_DATETIME
:
case
MYSQL_TYPE_DATE
:
case
MYSQL_TYPE_DATE
:
...
@@ -3493,6 +3494,24 @@ static int create_ndb_column(NDBCOL &col,
...
@@ -3493,6 +3494,24 @@ static int create_ndb_column(NDBCOL &col,
col
.
setLength
(
1
);
col
.
setLength
(
1
);
}
}
break
;
break
;
case
MYSQL_TYPE_NEWDECIMAL
:
{
Field_new_decimal
*
f
=
(
Field_new_decimal
*
)
field
;
uint
precision
=
f
->
field_length
;
uint
scale
=
f
->
decimals
();
if
(
field
->
flags
&
UNSIGNED_FLAG
)
{
col
.
setType
(
NDBCOL
::
Decimalunsigned
);
}
else
{
col
.
setType
(
NDBCOL
::
Decimal
);
}
col
.
setPrecision
(
precision
);
col
.
setScale
(
scale
);
col
.
setLength
(
1
);
}
break
;
// Date types
// Date types
case
MYSQL_TYPE_DATETIME
:
case
MYSQL_TYPE_DATETIME
:
col
.
setType
(
NDBCOL
::
Datetime
);
col
.
setType
(
NDBCOL
::
Datetime
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment