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
96188c81
Commit
96188c81
authored
Feb 16, 2005
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb
parents
59a986d9
63a19c47
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
536 additions
and
102 deletions
+536
-102
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/r/sp.result
mysql-test/r/sp.result
+10
-0
mysql-test/t/ndb_index_ordered.test
mysql-test/t/ndb_index_ordered.test
+52
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+16
-0
ndb/include/kernel/signaldata/DictTabInfo.hpp
ndb/include/kernel/signaldata/DictTabInfo.hpp
+49
-2
ndb/include/ndb_constants.h
ndb/include/ndb_constants.h
+5
-2
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+8
-5
ndb/include/transporter/TransporterRegistry.hpp
ndb/include/transporter/TransporterRegistry.hpp
+2
-3
ndb/include/util/NdbSqlUtil.hpp
ndb/include/util/NdbSqlUtil.hpp
+14
-3
ndb/src/common/mgmcommon/IPCConfig.cpp
ndb/src/common/mgmcommon/IPCConfig.cpp
+29
-0
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+37
-23
ndb/src/common/util/NdbSqlUtil.cpp
ndb/src/common/util/NdbSqlUtil.cpp
+114
-33
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+0
-4
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+1
-1
ndb/src/ndbapi/Ndb.cpp
ndb/src/ndbapi/Ndb.cpp
+3
-1
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+10
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+3
-0
ndb/src/ndbapi/NdbRecAttr.cpp
ndb/src/ndbapi/NdbRecAttr.cpp
+19
-1
ndb/src/ndbapi/NdbTransaction.cpp
ndb/src/ndbapi/NdbTransaction.cpp
+6
-2
ndb/src/ndbapi/TransporterFacade.cpp
ndb/src/ndbapi/TransporterFacade.cpp
+2
-3
ndb/src/ndbapi/TransporterFacade.hpp
ndb/src/ndbapi/TransporterFacade.hpp
+1
-2
ndb/src/ndbapi/ndb_cluster_connection.cpp
ndb/src/ndbapi/ndb_cluster_connection.cpp
+1
-1
ndb/test/include/NdbSchemaOp.hpp
ndb/test/include/NdbSchemaOp.hpp
+3
-0
ndb/test/src/HugoCalculator.cpp
ndb/test/src/HugoCalculator.cpp
+3
-0
ndb/tools/restore/consumer.cpp
ndb/tools/restore/consumer.cpp
+5
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+1
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+40
-5
sql/item.h
sql/item.h
+4
-1
No files found.
include/config-win.h
View file @
96188c81
...
...
@@ -31,18 +31,25 @@ functions */
#define HAVE_SMEM 1
#if defined(_
_NT__)
#define SYSTEM_TYPE "
NT"
#elif defined(_
_WIN2000__)
#define SYSTEM_TYPE "W
IN2000"
#if defined(_
WIN64) || defined(WIN64)
#define SYSTEM_TYPE "
Win64"
#elif defined(_
WIN32) || defined(WIN32)
#define SYSTEM_TYPE "W
in32"
#else
#define SYSTEM_TYPE "Win
95/Win98
"
#define SYSTEM_TYPE "Win
dows
"
#endif
#if defined(_WIN64) || defined(WIN64)
#define MACHINE_TYPE "ia64"
/* Define to machine type name */
#if defined(_M_IA64)
#define MACHINE_TYPE "ia64"
#elif defined(_M_IX86)
#define MACHINE_TYPE "ia32"
#elif defined(_M_ALPHA)
#define MACHINE_TYPE "axp"
#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
#define _WIN32
/* Compatible with old source */
#endif
...
...
mysql-test/r/ndb_index_ordered.result
View file @
96188c81
...
...
@@ -554,6 +554,89 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
count(*)-9
0
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));
insert into t1 values (1,1), (2,2);
set autocommit=0;
...
...
mysql-test/r/sp.result
View file @
96188c81
...
...
@@ -2059,6 +2059,16 @@ call bug6029()|
1136
drop procedure bug6029|
drop table t3|
drop procedure if exists bug8540|
create procedure bug8540()
begin
declare x int default 1;
select x as y, x+0 as z;
end|
call bug8540()|
y z
1 1
drop procedure bug8540|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
drop procedure if exists ifac|
...
...
mysql-test/t/ndb_index_ordered.test
View file @
96188c81
...
...
@@ -280,6 +280,58 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
drop
table
t1
;
# decimal (not the new 5.0 thing)
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
,
-
00000006
8391
,
-
0346486.00000
,
000000005071
,
0005334.00002
),
(
5
,
-
521579890459
,
-
1936874.00001
,
000000000154
,
0000003.00018
),
(
6
,
-
521579890459
,
-
1936874.00018
,
000000000154
,
0000003.00001
),
(
7
,
000000000333
,
0000051.39140
,
000000
907958
,
0788643.08374
),
(
8
,
00004273122
9
,
0000009.00000
,
00000000000
9
,
6428667.00000
),
(
9
,
-
00000
8159769
,
0000918.00004
,
0000
96951421
,
7607730.00008
);
#
select
count
(
*
)
-
5
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
(
*
)
-
5
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
;
# bug#7798
create
table
t1
(
a
int
primary
key
,
b
int
not
null
,
index
(
b
));
insert
into
t1
values
(
1
,
1
),
(
2
,
2
);
...
...
mysql-test/t/sp.test
View file @
96188c81
...
...
@@ -2520,6 +2520,22 @@ call bug6029()|
drop
procedure
bug6029
|
drop
table
t3
|
#
# BUG#8540: Local variable overrides an alias
#
--
disable_warnings
drop
procedure
if
exists
bug8540
|
--
enable_warnings
create
procedure
bug8540
()
begin
declare
x
int
default
1
;
select
x
as
y
,
x
+
0
as
z
;
end
|
call
bug8540
()
|
drop
procedure
bug8540
|
#
# Some "real" examples
...
...
ndb/include/kernel/signaldata/DictTabInfo.hpp
View file @
96188c81
...
...
@@ -24,6 +24,28 @@
#include <trigger_definitions.h>
#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) \
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
...
...
@@ -264,7 +286,10 @@ public:
ExtBigunsigned
=
NdbSqlUtil
::
Type
::
Bigunsigned
,
ExtFloat
=
NdbSqlUtil
::
Type
::
Float
,
ExtDouble
=
NdbSqlUtil
::
Type
::
Double
,
ExtOlddecimal
=
NdbSqlUtil
::
Type
::
Olddecimal
,
ExtOlddecimalunsigned
=
NdbSqlUtil
::
Type
::
Olddecimalunsigned
,
ExtDecimal
=
NdbSqlUtil
::
Type
::
Decimal
,
ExtDecimalunsigned
=
NdbSqlUtil
::
Type
::
Decimalunsigned
,
ExtChar
=
NdbSqlUtil
::
Type
::
Char
,
ExtVarchar
=
NdbSqlUtil
::
Type
::
Varchar
,
ExtBinary
=
NdbSqlUtil
::
Type
::
Binary
,
...
...
@@ -345,9 +370,31 @@ public:
AttributeSize
=
DictTabInfo
::
a64Bit
;
AttributeArraySize
=
AttributeExtLength
;
break
;
case
DictTabInfo
:
:
ExtOlddecimal
:
AttributeSize
=
DictTabInfo
::
an8Bit
;
AttributeArraySize
=
(
1
+
AttributeExtPrecision
+
(
int
(
AttributeExtScale
)
>
0
))
*
AttributeExtLength
;
break
;
case
DictTabInfo
:
:
ExtOlddecimalunsigned
:
AttributeSize
=
DictTabInfo
::
an8Bit
;
AttributeArraySize
=
(
0
+
AttributeExtPrecision
+
(
int
(
AttributeExtScale
)
>
0
))
*
AttributeExtLength
;
break
;
case
DictTabInfo
:
:
ExtDecimal
:
// not yet implemented anywhere
return
false
;
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
:
:
ExtBinary
:
AttributeSize
=
DictTabInfo
::
an8Bit
;
...
...
ndb/include/ndb_constants.h
View file @
96188c81
...
...
@@ -48,7 +48,7 @@
#define NDB_TYPE_BIGUNSIGNED 10
#define NDB_TYPE_FLOAT 11
#define NDB_TYPE_DOUBLE 12
#define NDB_TYPE_
DECIMAL 13
/* not used */
#define NDB_TYPE_
OLDDECIMAL 13
#define NDB_TYPE_CHAR 14
#define NDB_TYPE_VARCHAR 15
#define NDB_TYPE_BINARY 16
...
...
@@ -63,7 +63,10 @@
#define NDB_TYPE_TIME 25
#define NDB_TYPE_YEAR 26
#define NDB_TYPE_TIMESTAMP 27
#define NDB_TYPE_OLDDECIMALUNSIGNED 28
#define NDB_TYPE_DECIMAL 29
#define NDB_TYPE_DECIMALUNSIGNED 30
#define NDB_TYPE_MAX
28
#define NDB_TYPE_MAX
31
#endif
ndb/include/ndbapi/NdbDictionary.hpp
View file @
96188c81
...
...
@@ -184,7 +184,10 @@ public:
Bigunsigned
=
NDB_TYPE_BIGUNSIGNED
,
///< 64 Bit. 8 byte signed integer, can be used in array
Float
=
NDB_TYPE_FLOAT
,
///< 32-bit float. 4 bytes float, can be used in array
Double
=
NDB_TYPE_DOUBLE
,
///< 64-bit float. 8 byte float, can be used in array
Decimal
=
NDB_TYPE_DECIMAL
,
///< Precision, Scale are applicable
Olddecimal
=
NDB_TYPE_OLDDECIMAL
,
///< MySQL < 5.0 signed decimal, Precision, Scale
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
Varchar
=
NDB_TYPE_VARCHAR
,
///< Length bytes: 1, Max: 255
Binary
=
NDB_TYPE_BINARY
,
///< Len
...
...
@@ -248,13 +251,13 @@ public:
/**
* Get precision of column.
* @note Only applicable for
builtin type Decimal
* @note Only applicable for
decimal types
*/
int
getPrecision
()
const
;
/**
* Get scale of column.
* @note Only applicable for
builtin type Decimal
* @note Only applicable for
decimal types
*/
int
getScale
()
const
;
...
...
@@ -372,13 +375,13 @@ public:
/**
* Set precision of column.
* @note Only applicable for
builtin type Decimal
* @note Only applicable for
decimal types
*/
void
setPrecision
(
int
);
/**
* Set scale of column.
* @note Only applicable for
builtin type Decimal
* @note Only applicable for
decimal types
*/
void
setScale
(
int
);
...
...
ndb/include/transporter/TransporterRegistry.hpp
View file @
96188c81
...
...
@@ -97,12 +97,11 @@ public:
/**
* Constructor
*/
TransporterRegistry
(
NdbMgmHandle
mgm_handle
=
NULL
,
void
*
callback
=
0
,
TransporterRegistry
(
void
*
callback
=
0
,
unsigned
maxTransporters
=
MAX_NTRANSPORTERS
,
unsigned
sizeOfLongSignalMemory
=
100
);
void
set_mgm_handle
(
NdbMgmHandle
h
)
{
m_mgm_handle
=
h
;
}
;
void
set_mgm_handle
(
NdbMgmHandle
h
);
NdbMgmHandle
get_mgm_handle
(
void
)
{
return
m_mgm_handle
;
};
bool
init
(
NodeId
localNodeId
);
...
...
ndb/include/util/NdbSqlUtil.hpp
View file @
96188c81
...
...
@@ -80,7 +80,7 @@ public:
Bigunsigned
=
NDB_TYPE_BIGUNSIGNED
,
Float
=
NDB_TYPE_FLOAT
,
Double
=
NDB_TYPE_DOUBLE
,
Decimal
=
NDB_TYPE_
DECIMAL
,
Olddecimal
=
NDB_TYPE_OLD
DECIMAL
,
Char
=
NDB_TYPE_CHAR
,
Varchar
=
NDB_TYPE_VARCHAR
,
Binary
=
NDB_TYPE_BINARY
,
...
...
@@ -94,7 +94,10 @@ public:
Longvarbinary
=
NDB_TYPE_LONG_VARBINARY
,
Time
=
NDB_TYPE_TIME
,
Year
=
NDB_TYPE_YEAR
,
Timestamp
=
NDB_TYPE_TIMESTAMP
Timestamp
=
NDB_TYPE_TIMESTAMP
,
Olddecimalunsigned
=
NDB_TYPE_OLDDECIMALUNSIGNED
,
Decimal
=
NDB_TYPE_DECIMAL
,
Decimalunsigned
=
NDB_TYPE_DECIMALUNSIGNED
};
Enum
m_typeId
;
// redundant
Cmp
*
m_cmp
;
// comparison method
...
...
@@ -130,6 +133,11 @@ public:
*/
static
int
strnxfrm_bug7284
(
CHARSET_INFO
*
cs
,
unsigned
char
*
dst
,
unsigned
dstLen
,
const
unsigned
char
*
src
,
unsigned
srcLen
);
/**
* Compare decimal numbers.
*/
static
int
cmp_olddecimal
(
const
uchar
*
s1
,
const
uchar
*
s2
,
unsigned
n
);
private:
/**
* List of all types. Must match Type::Enum.
...
...
@@ -150,7 +158,7 @@ private:
static
Cmp
cmpBigunsigned
;
static
Cmp
cmpFloat
;
static
Cmp
cmpDouble
;
static
Cmp
cmp
D
ecimal
;
static
Cmp
cmp
Oldd
ecimal
;
static
Cmp
cmpChar
;
static
Cmp
cmpVarchar
;
static
Cmp
cmpBinary
;
...
...
@@ -165,6 +173,9 @@ private:
static
Cmp
cmpTime
;
static
Cmp
cmpYear
;
static
Cmp
cmpTimestamp
;
static
Cmp
cmpOlddecimalunsigned
;
static
Cmp
cmpDecimal
;
static
Cmp
cmpDecimalunsigned
;
};
#endif
ndb/src/common/mgmcommon/IPCConfig.cpp
View file @
96188c81
...
...
@@ -170,6 +170,35 @@ IPCConfig::configureTransporters(Uint32 nodeId,
DBUG_ENTER
(
"IPCConfig::configureTransporters"
);
/**
* Iterate over all MGM's an construct a connectstring
* create mgm_handle and give it to the Transporter Registry
*/
{
const
char
*
separator
=
""
;
BaseString
connect_string
;
ndb_mgm_configuration_iterator
iter
(
config
,
CFG_SECTION_NODE
);
for
(
iter
.
first
();
iter
.
valid
();
iter
.
next
())
{
Uint32
type
;
if
(
iter
.
get
(
CFG_TYPE_OF_SECTION
,
&
type
))
continue
;
if
(
type
!=
NODE_TYPE_MGM
)
continue
;
const
char
*
hostname
;
Uint32
port
;
if
(
iter
.
get
(
CFG_NODE_HOST
,
&
hostname
))
continue
;
if
(
strlen
(
hostname
)
==
0
)
continue
;
if
(
iter
.
get
(
CFG_MGM_PORT
,
&
port
))
continue
;
connect_string
.
appfmt
(
"%s%s:port"
,
separator
,
hostname
,
port
);
separator
=
","
;
}
NdbMgmHandle
h
=
ndb_mgm_create_handle
();
if
(
h
&&
connect_string
.
length
()
>
0
)
{
ndb_mgm_set_connectstring
(
h
,
connect_string
.
c_str
());
tr
.
set_mgm_handle
(
h
);
}
}
Uint32
noOfTransportersCreated
=
0
;
ndb_mgm_configuration_iterator
iter
(
config
,
CFG_SECTION_CONNECTION
);
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
96188c81
...
...
@@ -71,15 +71,14 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
DBUG_RETURN
(
0
);
}
TransporterRegistry
::
TransporterRegistry
(
NdbMgmHandle
mgm_handle
,
void
*
callback
,
TransporterRegistry
::
TransporterRegistry
(
void
*
callback
,
unsigned
_maxTransporters
,
unsigned
sizeOfLongSignalMemory
)
{
nodeIdSpecified
=
false
;
maxTransporters
=
_maxTransporters
;
sendCounter
=
1
;
m_mgm_handle
=
mgm_handle
;
m_mgm_handle
=
0
;
callbackObj
=
callback
;
...
...
@@ -114,6 +113,27 @@ TransporterRegistry::TransporterRegistry(NdbMgmHandle mgm_handle,
theOSEJunkSocketRecv
=
0
;
}
void
TransporterRegistry
::
set_mgm_handle
(
NdbMgmHandle
h
)
{
DBUG_ENTER
(
"TransporterRegistry::set_mgm_handle"
);
if
(
m_mgm_handle
)
ndb_mgm_destroy_handle
(
&
m_mgm_handle
);
m_mgm_handle
=
h
;
#ifndef DBUG_OFF
if
(
h
)
{
char
buf
[
256
];
DBUG_PRINT
(
"info"
,(
"handle set with connectstring: %s"
,
ndb_mgm_get_connectstring
(
h
,
buf
,
sizeof
(
buf
))));
}
else
{
DBUG_PRINT
(
"info"
,(
"handle set to NULL"
));
}
#endif
DBUG_VOID_RETURN
;
};
TransporterRegistry
::~
TransporterRegistry
()
{
removeAll
();
...
...
@@ -134,6 +154,8 @@ TransporterRegistry::~TransporterRegistry() {
theOSEReceiver
=
0
;
}
#endif
if
(
m_mgm_handle
)
ndb_mgm_destroy_handle
(
&
m_mgm_handle
);
}
void
...
...
@@ -1211,40 +1233,32 @@ TransporterRegistry::start_clients_thread()
switch
(
performStates
[
nodeId
]){
case
CONNECTING
:
if
(
!
t
->
isConnected
()
&&
!
t
->
isServer
)
{
int
result
=
0
;
bool
connected
=
false
;
/**
* First, we try to connect (if we have a port number).
*/
if
(
t
->
get_s_port
())
result
=
t
->
connect_client
();
connected
=
t
->
connect_client
();
if
(
result
<
0
&&
t
->
get_s_port
()
!=
0
)
g_eventLogger
.
warning
(
"Error while trying to make connection "
"(Node %u to %u via port %u) "
"error: %d. Retrying..."
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
t
->
get_s_port
());
/**
* If dynamic, get the port for connecting from the management server
*/
if
(
t
->
get_s_port
()
<=
0
)
{
// Port is dynamic
if
(
!
connected
&&
t
->
get_s_port
()
<=
0
)
{
// Port is dynamic
int
server_port
=
0
;
struct
ndb_mgm_reply
mgm_reply
;
int
res
;
int
res
=
-
1
;
if
(
!
ndb_mgm_is_connected
(
m_mgm_handle
))
if
(
ndb_mgm_connect
(
m_mgm_handle
,
0
,
0
,
0
)
<
0
)
ndbout_c
(
"Failed to reconnect to management server"
);
res
=
ndb_mgm_get_connection_int_parameter
(
m_mgm_handle
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
CFG_CONNECTION_SERVER_PORT
,
&
server_port
,
&
mgm_reply
);
else
res
=
ndb_mgm_get_connection_int_parameter
(
m_mgm_handle
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
CFG_CONNECTION_SERVER_PORT
,
&
server_port
,
&
mgm_reply
);
DBUG_PRINT
(
"info"
,(
"Got dynamic port %d for %d -> %d (ret: %d)"
,
server_port
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
res
));
...
...
ndb/src/common/util/NdbSqlUtil.cpp
View file @
96188c81
...
...
@@ -77,117 +77,129 @@ NdbSqlUtil::char_like(const char* s1, unsigned n1,
const
NdbSqlUtil
::
Type
NdbSqlUtil
::
m_typeList
[]
=
{
{
{
// 0
Type
::
Undefined
,
NULL
},
{
{
// 1
Type
::
Tinyint
,
cmpTinyint
},
{
{
// 2
Type
::
Tinyunsigned
,
cmpTinyunsigned
},
{
{
// 3
Type
::
Smallint
,
cmpSmallint
},
{
{
// 4
Type
::
Smallunsigned
,
cmpSmallunsigned
},
{
{
// 5
Type
::
Mediumint
,
cmpMediumint
},
{
{
// 6
Type
::
Mediumunsigned
,
cmpMediumunsigned
},
{
{
// 7
Type
::
Int
,
cmpInt
},
{
{
// 8
Type
::
Unsigned
,
cmpUnsigned
},
{
{
// 9
Type
::
Bigint
,
cmpBigint
},
{
{
// 10
Type
::
Bigunsigned
,
cmpBigunsigned
},
{
{
// 11
Type
::
Float
,
cmpFloat
},
{
{
// 12
Type
::
Double
,
cmpDouble
},
{
Type
::
D
ecimal
,
NULL
// cmpD
ecimal
{
// 13
Type
::
Oldd
ecimal
,
cmpOldd
ecimal
},
{
{
// 14
Type
::
Char
,
cmpChar
},
{
{
// 15
Type
::
Varchar
,
cmpVarchar
},
{
{
// 16
Type
::
Binary
,
cmpBinary
},
{
{
// 17
Type
::
Varbinary
,
cmpVarbinary
},
{
{
// 18
Type
::
Datetime
,
cmpDatetime
},
{
{
// 19
Type
::
Date
,
cmpDate
},
{
{
// 20
Type
::
Blob
,
NULL
// cmpBlob
},
{
{
// 21
Type
::
Text
,
NULL
// cmpText
},
{
{
// 22
Type
::
Bit
,
NULL
// cmpBit
},
{
{
// 23
Type
::
Longvarchar
,
cmpLongvarchar
},
{
{
// 24
Type
::
Longvarbinary
,
cmpLongvarbinary
},
{
{
// 25
Type
::
Time
,
cmpTime
},
{
{
// 26
Type
::
Year
,
cmpYear
},
{
{
// 27
Type
::
Timestamp
,
cmpTimestamp
},
{
// 28
Type
::
Olddecimalunsigned
,
cmpOlddecimalunsigned
},
{
// 29
Type
::
Decimal
,
cmpDecimal
},
{
// 30
Type
::
Decimalunsigned
,
cmpDecimalunsigned
}
};
...
...
@@ -430,14 +442,83 @@ NdbSqlUtil::cmpDouble(const void* info, const void* p1, unsigned n1, const void*
return
CmpUnknown
;
}
// not used by MySQL or NDB
int
NdbSqlUtil
::
cmp
Decimal
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
NdbSqlUtil
::
cmp
_olddecimal
(
const
uchar
*
s1
,
const
uchar
*
s2
,
unsigned
n
)
{
assert
(
false
);
int
sgn
=
+
1
;
unsigned
i
=
0
;
while
(
i
<
n
)
{
int
c1
=
s1
[
i
];
int
c2
=
s2
[
i
];
if
(
c1
==
c2
)
{
if
(
c1
==
'-'
)
sgn
=
-
1
;
}
else
if
(
c1
==
'-'
)
{
return
-
1
;
}
else
if
(
c2
==
'-'
)
{
return
+
1
;
}
else
if
(
c1
<
c2
)
{
return
-
1
*
sgn
;
}
else
{
return
+
1
*
sgn
;
}
i
++
;
}
return
0
;
}
int
NdbSqlUtil
::
cmpOlddecimal
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
if
(
full
)
{
assert
(
n1
==
n2
);
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
return
cmp_olddecimal
(
v1
,
v2
,
n1
);
}
return
CmpUnknown
;
}
int
NdbSqlUtil
::
cmpOlddecimalunsigned
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
if
(
full
)
{
assert
(
n1
==
n2
);
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
return
cmp_olddecimal
(
v1
,
v2
,
n1
);
}
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
NdbSqlUtil
::
cmpChar
(
const
void
*
info
,
const
void
*
p1
,
unsigned
n1
,
const
void
*
p2
,
unsigned
n2
,
bool
full
)
{
...
...
ndb/src/kernel/main.cpp
View file @
96188c81
...
...
@@ -92,10 +92,6 @@ int main(int argc, char** argv)
}
}
globalTransporterRegistry
.
set_mgm_handle
(
theConfig
->
get_config_retriever
()
->
get_mgmHandle
());
#ifndef NDB_WIN32
for
(
pid_t
child
=
fork
();
child
!=
0
;
child
=
fork
()){
/**
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
96188c81
...
...
@@ -576,7 +576,7 @@ MgmtSrvr::start(BaseString &error_string)
}
}
theFacade
=
TransporterFacade
::
theFacadeInstance
=
new
TransporterFacade
(
m_config_retriever
->
get_mgmHandle
()
);
=
new
TransporterFacade
();
if
(
theFacade
==
0
)
{
DEBUG
(
"MgmtSrvr.cpp: theFacade is NULL."
);
...
...
ndb/src/ndbapi/Ndb.cpp
View file @
96188c81
...
...
@@ -84,7 +84,9 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
}
else
if
(
TretCode
!=
0
)
{
tAnyAlive
=
1
;
}
//if
DBUG_PRINT
(
"info"
,(
"tried node %d TretCode %d"
,
tNode
,
TretCode
));
DBUG_PRINT
(
"info"
,(
"tried node %d, TretCode %d, error code %d, %s"
,
tNode
,
TretCode
,
getNdbError
().
code
,
getNdbError
().
message
));
}
}
else
// just do a regular round robin
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
96188c81
...
...
@@ -948,8 +948,17 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
case
NdbDictionary
:
:
Column
::
Double
:
out
<<
"Double"
;
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
out
<<
"Olddecimal("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
out
<<
"Olddecimalunsigned("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
out
<<
"Decimal("
<<
col
.
getScale
()
<<
","
<<
col
.
getPrecision
()
<<
")"
;
out
<<
"Decimal("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
out
<<
"Decimalunsigned("
<<
col
.
getPrecision
()
<<
","
<<
col
.
getScale
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Char
:
out
<<
"Char("
<<
col
.
getLength
()
<<
";"
<<
csname
<<
")"
;
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
96188c81
...
...
@@ -109,7 +109,10 @@ NdbColumnImpl::init(Type t)
m_length
=
1
;
m_cs
=
NULL
;
break
;
case
Olddecimal
:
case
Olddecimalunsigned
:
case
Decimal
:
case
Decimalunsigned
:
m_precision
=
10
;
m_scale
=
0
;
m_length
=
1
;
...
...
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
96188c81
...
...
@@ -178,7 +178,8 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
return
out
;
}
uint
length
=
r
.
getColumn
()
->
getLength
();
const
NdbDictionary
::
Column
*
c
=
r
.
getColumn
();
uint
length
=
c
->
getLength
();
if
(
length
>
1
)
out
<<
"["
;
...
...
@@ -237,6 +238,22 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
case
NdbDictionary
:
:
Column
::
Double
:
out
<<
r
.
double_value
();
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
{
short
len
=
1
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
{
short
len
=
0
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
goto
unknown
;
// TODO
break
;
// for dates cut-and-paste from field.cc
case
NdbDictionary
:
:
Column
::
Datetime
:
{
...
...
@@ -346,6 +363,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
j
=
length
;
}
break
;
unknown:
default:
/* no print functions for the rest, just print type */
out
<<
(
int
)
r
.
getType
();
j
=
length
;
...
...
ndb/src/ndbapi/NdbTransaction.cpp
View file @
96188c81
...
...
@@ -1420,14 +1420,18 @@ Remark: Sets TC Connect pointer.
int
NdbTransaction
::
receiveTCSEIZEREF
(
NdbApiSignal
*
aSignal
)
{
DBUG_ENTER
(
"NdbTransaction::receiveTCSEIZEREF"
);
if
(
theStatus
!=
Connecting
)
{
return
-
1
;
DBUG_RETURN
(
-
1
)
;
}
else
{
theStatus
=
ConnectFailure
;
theNdb
->
theError
.
code
=
aSignal
->
readData
(
2
);
return
0
;
DBUG_PRINT
(
"info"
,(
"error code %d, %s"
,
theNdb
->
getNdbError
().
code
,
theNdb
->
getNdbError
().
message
));
DBUG_RETURN
(
0
);
}
}
//NdbTransaction::receiveTCSEIZEREF()
...
...
ndb/src/ndbapi/TransporterFacade.cpp
View file @
96188c81
...
...
@@ -466,8 +466,7 @@ void TransporterFacade::threadMainReceive(void)
theTransporterRegistry
->
stopReceiving
();
}
TransporterFacade
::
TransporterFacade
(
NdbMgmHandle
mgm_handle
)
:
m_mgm_handle
(
mgm_handle
),
TransporterFacade
::
TransporterFacade
()
:
theTransporterRegistry
(
0
),
theStopReceive
(
0
),
theSendThread
(
NULL
),
...
...
@@ -496,7 +495,7 @@ bool
TransporterFacade
::
init
(
Uint32
nodeId
,
const
ndb_mgm_configuration
*
props
)
{
theOwnId
=
nodeId
;
theTransporterRegistry
=
new
TransporterRegistry
(
m_mgm_handle
,
this
);
theTransporterRegistry
=
new
TransporterRegistry
(
this
);
const
int
res
=
IPCConfig
::
configureTransporters
(
nodeId
,
*
props
,
...
...
ndb/src/ndbapi/TransporterFacade.hpp
View file @
96188c81
...
...
@@ -47,7 +47,7 @@ extern "C" {
class
TransporterFacade
{
public:
TransporterFacade
(
NdbMgmHandle
mgm_handle
);
TransporterFacade
();
virtual
~
TransporterFacade
();
bool
init
(
Uint32
,
const
ndb_mgm_configuration
*
);
...
...
@@ -133,7 +133,6 @@ private:
bool
isConnected
(
NodeId
aNodeId
);
void
doStop
();
NdbMgmHandle
m_mgm_handle
;
TransporterRegistry
*
theTransporterRegistry
;
SocketServer
m_socket_server
;
int
sendPerformedLastInterval
;
...
...
ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
96188c81
...
...
@@ -284,7 +284,7 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
m_transporter_facade
=
TransporterFacade
::
theFacadeInstance
=
new
TransporterFacade
(
m_config_retriever
->
get_mgmHandle
()
);
new
TransporterFacade
();
DBUG_VOID_RETURN
;
}
...
...
ndb/test/include/NdbSchemaOp.hpp
View file @
96188c81
...
...
@@ -567,7 +567,10 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type)
case
NdbDictionary
:
:
Column
::
Unsigned
:
return
UnSigned
;
case
NdbDictionary
:
:
Column
::
Float
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
case
NdbDictionary
:
:
Column
::
Double
:
return
Float
;
case
NdbDictionary
:
:
Column
::
Char
:
...
...
ndb/test/src/HugoCalculator.cpp
View file @
96188c81
...
...
@@ -145,7 +145,10 @@ HugoCalculator::calcValue(int record,
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
case
NdbDictionary
:
:
Column
::
Float
:
case
NdbDictionary
:
:
Column
::
Double
:
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
case
NdbDictionary
:
:
Column
::
Binary
:
case
NdbDictionary
:
:
Column
::
Datetime
:
case
NdbDictionary
:
:
Column
::
Time
:
...
...
ndb/tools/restore/consumer.cpp
View file @
96188c81
...
...
@@ -44,9 +44,14 @@ BackupConsumer::create_table_string(const TableS & table,
case
NdbDictionary
:
:
Column
::
Float
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"float"
);
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
case
NdbDictionary
:
:
Column
::
Decimal
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal"
);
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"decimal unsigned"
);
break
;
case
NdbDictionary
:
:
Column
::
Char
:
pos
+=
sprintf
(
buf
+
pos
,
"%s"
,
"char"
);
break
;
...
...
sql/ha_innodb.cc
View file @
96188c81
...
...
@@ -602,7 +602,7 @@ innobase_mysql_tmpfile(void)
{
char
filename
[
FN_REFLEN
];
int
fd2
=
-
1
;
File
fd
=
create_temp_file
(
filename
,
NullS
,
"ib"
,
File
fd
=
create_temp_file
(
filename
,
mysql_tmpdir
,
"ib"
,
#ifdef __WIN__
O_BINARY
|
O_TRUNC
|
O_SEQUENTIAL
|
O_TEMPORARY
|
O_SHORT_LIVED
|
...
...
sql/ha_ndbcluster.cc
View file @
96188c81
...
...
@@ -445,7 +445,6 @@ bool ha_ndbcluster::get_error_message(int error,
static
inline
bool
ndb_supported_type
(
enum_field_types
type
)
{
switch
(
type
)
{
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_LONG
:
...
...
@@ -453,6 +452,8 @@ static inline bool ndb_supported_type(enum_field_types type)
case
MYSQL_TYPE_LONGLONG
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_DOUBLE
:
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_TIMESTAMP
:
case
MYSQL_TYPE_DATETIME
:
case
MYSQL_TYPE_DATE
:
...
...
@@ -3337,10 +3338,6 @@ static int create_ndb_column(NDBCOL &col,
const
enum
enum_field_types
mysql_type
=
field
->
real_type
();
switch
(
mysql_type
)
{
// Numeric types
case
MYSQL_TYPE_DECIMAL
:
col
.
setType
(
NDBCOL
::
Char
);
col
.
setLength
(
field
->
pack_length
());
break
;
case
MYSQL_TYPE_TINY
:
if
(
field
->
flags
&
UNSIGNED_FLAG
)
col
.
setType
(
NDBCOL
::
Tinyunsigned
);
...
...
@@ -3384,6 +3381,44 @@ static int create_ndb_column(NDBCOL &col,
col
.
setType
(
NDBCOL
::
Double
);
col
.
setLength
(
1
);
break
;
case
MYSQL_TYPE_DECIMAL
:
{
Field_decimal
*
f
=
(
Field_decimal
*
)
field
;
uint
precision
=
f
->
pack_length
();
uint
scale
=
f
->
decimals
();
if
(
field
->
flags
&
UNSIGNED_FLAG
)
{
col
.
setType
(
NDBCOL
::
Olddecimalunsigned
);
precision
-=
(
scale
>
0
);
}
else
{
col
.
setType
(
NDBCOL
::
Olddecimal
);
precision
-=
1
+
(
scale
>
0
);
}
col
.
setPrecision
(
precision
);
col
.
setScale
(
scale
);
col
.
setLength
(
1
);
}
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
case
MYSQL_TYPE_DATETIME
:
col
.
setType
(
NDBCOL
::
Datetime
);
...
...
sql/item.h
View file @
96188c81
...
...
@@ -471,7 +471,10 @@ class Item_splocal : public Item
{
Item
*
it
=
this_item
();
it
->
set_name
(
m_name
.
str
,
m_name
.
length
,
system_charset_info
);
if
(
name
)
it
->
set_name
(
name
,
strlen
(
name
),
system_charset_info
);
else
it
->
set_name
(
m_name
.
str
,
m_name
.
length
,
system_charset_info
);
it
->
make_field
(
field
);
}
...
...
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