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
b371e8a5
Commit
b371e8a5
authored
Feb 14, 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
f72082ea
e3a39c9e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
156 additions
and
55 deletions
+156
-55
Build-tools/Do-compile
Build-tools/Do-compile
+4
-2
include/my_pthread.h
include/my_pthread.h
+1
-1
mysql-test/r/select.result
mysql-test/r/select.result
+13
-0
mysql-test/t/select.test
mysql-test/t/select.test
+15
-0
ndb/src/common/transporter/Transporter.cpp
ndb/src/common/transporter/Transporter.cpp
+9
-6
ndb/src/common/transporter/Transporter.hpp
ndb/src/common/transporter/Transporter.hpp
+9
-7
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+43
-34
ndb/test/run-test/make-html-reports.sh
ndb/test/run-test/make-html-reports.sh
+5
-1
sql/ha_innodb.cc
sql/ha_innodb.cc
+20
-0
sql/ha_innodb.h
sql/ha_innodb.h
+5
-0
sql/handler.h
sql/handler.h
+6
-0
sql/sql_show.cc
sql/sql_show.cc
+25
-4
sql/table.cc
sql/table.cc
+1
-0
No files found.
Build-tools/Do-compile
View file @
b371e8a5
...
...
@@ -811,7 +811,7 @@ sub find
sub
rm_all
{
my
(
@rm_files
)
=
@_
;
my
(
$dir
,
$current_dir
,
@files
,
@dirs
);
my
(
$dir
,
$current_dir
,
@files
,
@dirs
,
$removed
);
$current_dir
=
`
pwd
`;
chomp
(
$current_dir
);
foreach
$dir
(
@rm_files
)
...
...
@@ -835,7 +835,9 @@ sub rm_all
}
if
(
$#files
>=
0
)
{
system
("
rm -f
"
.
join
("
",
@files
))
&&
abort
("
Can't remove files from
$dir
");
$removed
=
unlink
@files
;
print
"
rm_all : removed
$removed
files in
$current_dir
/
$dir
\n
"
if
(
$opt_debug
);
abort
("
Can't remove all $#files+1 from
$current_dir
/
$dir
, just
$removed
")
if
$removed
!=
$#files
+
1
;
}
foreach
$dir
(
@dirs
)
{
...
...
include/my_pthread.h
View file @
b371e8a5
...
...
@@ -637,7 +637,7 @@ extern int pthread_dummy(int);
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames
*/
#define DEFAULT_THREAD_STACK (
192
*1024L)
#define DEFAULT_THREAD_STACK (
256
*1024L)
#else
#define DEFAULT_THREAD_STACK (192*1024)
#endif
...
...
mysql-test/r/select.result
View file @
b371e8a5
...
...
@@ -2388,3 +2388,16 @@ WART 0100 1
WART 0200 1
WART 0300 3
DROP TABLE t1;
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2;
mysql-test/t/select.test
View file @
b371e8a5
...
...
@@ -1970,3 +1970,18 @@ SELECT K2C4, K4N4, F2I4 FROM t1
WHERE
K2C4
=
'WART'
AND
(
K2C4
=
'WART'
OR
K4N4
=
'0200'
);
DROP
TABLE
t1
;
#
# Test case for bug 7520: a wrong cost of the index for a BLOB field
#
CREATE
TABLE
t1
(
a
BLOB
,
INDEX
(
a
(
20
))
);
CREATE
TABLE
t2
(
a
BLOB
,
INDEX
(
a
(
20
))
);
INSERT
INTO
t1
VALUES
(
'one'
),(
'two'
),(
'three'
),(
'four'
),(
'five'
);
INSERT
INTO
t2
VALUES
(
'one'
),(
'two'
),(
'three'
),(
'four'
),(
'five'
);
EXPLAIN
SELECT
*
FROM
t1
LEFT
JOIN
t2
USE
INDEX
(a) ON t1.a=t2.a
;
EXPLAIN
SELECT
*
FROM
t1
LEFT
JOIN
t2
FORCE
INDEX
(
a
)
ON
t1
.
a
=
t2
.
a
;
DROP
TABLE
t1
,
t2
;
ndb/src/common/transporter/Transporter.cpp
View file @
b371e8a5
...
...
@@ -31,14 +31,14 @@ Transporter::Transporter(TransporterRegistry &t_reg,
TransporterType
_type
,
const
char
*
lHostName
,
const
char
*
rHostName
,
int
r
_port
,
int
s
_port
,
bool
_isMgmConnection
,
NodeId
lNodeId
,
NodeId
rNodeId
,
NodeId
serverNodeId
,
int
_byteorder
,
bool
_compression
,
bool
_checksum
,
bool
_signalId
)
:
m_
r_port
(
r
_port
),
remoteNodeId
(
rNodeId
),
localNodeId
(
lNodeId
),
:
m_
s_port
(
s
_port
),
remoteNodeId
(
rNodeId
),
localNodeId
(
lNodeId
),
isServer
(
lNodeId
==
serverNodeId
),
isMgmConnection
(
_isMgmConnection
),
m_packer
(
_signalId
,
_checksum
),
m_type
(
_type
),
...
...
@@ -63,10 +63,10 @@ Transporter::Transporter(TransporterRegistry &t_reg,
if
(
strlen
(
lHostName
)
>
0
)
Ndb_getInAddr
(
&
localHostAddress
,
lHostName
);
DBUG_PRINT
(
"info"
,(
"rId=%d lId=%d isServer=%d rHost=%s lHost=%s
r
_port=%d"
,
DBUG_PRINT
(
"info"
,(
"rId=%d lId=%d isServer=%d rHost=%s lHost=%s
s
_port=%d"
,
remoteNodeId
,
localNodeId
,
isServer
,
remoteHostName
,
localHostName
,
r
_port
));
s
_port
));
byteOrder
=
_byteorder
;
compressionUsed
=
_compression
;
...
...
@@ -76,10 +76,13 @@ Transporter::Transporter(TransporterRegistry &t_reg,
m_connected
=
false
;
m_timeOutMillis
=
1000
;
if
(
s_port
<
0
)
s_port
=
-
s_port
;
// was dynamic
if
(
isServer
)
m_socket_client
=
0
;
else
m_socket_client
=
new
SocketClient
(
remoteHostName
,
r
_port
,
m_socket_client
=
new
SocketClient
(
remoteHostName
,
s
_port
,
new
SocketAuthSimple
(
"ndbd"
,
"ndbd passwd"
));
DBUG_VOID_RETURN
;
...
...
@@ -126,7 +129,7 @@ Transporter::connect_client() {
DBUG_ENTER
(
"Transporter::connect_client"
);
DBUG_PRINT
(
"info"
,(
"port %d isMgmConnection=%d"
,
m_
r
_port
,
isMgmConnection
));
DBUG_PRINT
(
"info"
,(
"port %d isMgmConnection=%d"
,
m_
s
_port
,
isMgmConnection
));
SocketOutputStream
s_output
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
...
...
ndb/src/common/transporter/Transporter.hpp
View file @
b371e8a5
...
...
@@ -70,15 +70,17 @@ public:
NodeId
getLocalNodeId
()
const
;
/**
* Get
r_port we're connecting to
* Get
port we're connecting to (signed)
*/
unsigned
int
get_r_port
()
{
return
m_r
_port
;
};
int
get_s_port
()
{
return
m_s
_port
;
};
/**
* Set
r_port to connect to
* Set
port to connect to (signed)
*/
void
set_r_port
(
unsigned
int
port
)
{
m_r_port
=
port
;
void
set_s_port
(
int
port
)
{
m_s_port
=
port
;
if
(
port
<
0
)
port
=
-
port
;
if
(
m_socket_client
)
m_socket_client
->
set_port
(
port
);
};
...
...
@@ -88,7 +90,7 @@ protected:
TransporterType
,
const
char
*
lHostName
,
const
char
*
rHostName
,
int
r
_port
,
int
s
_port
,
bool
isMgmConnection
,
NodeId
lNodeId
,
NodeId
rNodeId
,
...
...
@@ -118,7 +120,7 @@ protected:
struct
in_addr
remoteHostAddress
;
struct
in_addr
localHostAddress
;
unsigned
int
m_r
_port
;
int
m_s
_port
;
const
NodeId
remoteNodeId
;
const
NodeId
localNodeId
;
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
b371e8a5
...
...
@@ -1211,7 +1211,7 @@ TransporterRegistry::start_clients_thread()
switch
(
performStates
[
nodeId
]){
case
CONNECTING
:
if
(
!
t
->
isConnected
()
&&
!
t
->
isServer
)
{
if
(
t
->
get_
r
_port
()
<=
0
)
{
// Port is dynamic
if
(
t
->
get_
s
_port
()
<=
0
)
{
// Port is dynamic
int
server_port
=
0
;
struct
ndb_mgm_reply
mgm_reply
;
int
res
;
...
...
@@ -1222,27 +1222,24 @@ TransporterRegistry::start_clients_thread()
CFG_CONNECTION_SERVER_PORT
,
&
server_port
,
&
mgm_reply
);
DBUG_PRINT
(
"info"
,(
"Got %s port %u for %d -> %d (ret: %d)"
,
(
server_port
<=
0
)
?
"dynamic"
:
"static"
,
DBUG_PRINT
(
"info"
,(
"Got dynamic port %d for %d -> %d (ret: %d)"
,
server_port
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
res
));
if
(
server_port
<
0
)
server_port
=
-
server_port
;
// was a dynamic port
if
(
res
>=
0
)
t
->
set_
r
_port
(
server_port
);
if
(
res
>=
0
&&
server_port
)
t
->
set_
s
_port
(
server_port
);
else
ndbout_c
(
"Failed to get dynamic port to connect to: %d"
,
res
);
}
if
(
theTransporterTypes
[
nodeId
]
!=
tt_TCP_TRANSPORTER
||
t
->
get_
r
_port
()
>
0
)
{
||
t
->
get_
s
_port
()
>
0
)
{
int
result
=
t
->
connect_client
();
if
(
result
<
0
)
ndbout_c
(
"Error while trying to make connection (Node %u to"
" %u via port %u) error: %d. Retrying..."
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
t
->
get_
r
_port
());
t
->
get_
s
_port
());
}
else
NdbSleep_MilliSleep
(
400
);
// wait before retrying
}
...
...
@@ -1486,44 +1483,56 @@ TransporterRegistry::get_transporter(NodeId nodeId) {
NDB_SOCKET_TYPE
TransporterRegistry
::
connect_ndb_mgmd
(
SocketClient
*
sc
)
{
NdbMgmHandle
h
;
NdbMgmHandle
h
=
ndb_mgm_create_handle
()
;
struct
ndb_mgm_reply
mgm_reply
;
char
*
cs
,
c
[
100
];
bool
d
=
false
;
h
=
ndb_mgm_create_handle
();
if
(
strlen
(
sc
->
get_server_name
())
>
80
)
if
(
h
==
NULL
)
{
/*
* server name is long. malloc enough for it and the port number
*/
cs
=
(
char
*
)
malloc
((
strlen
(
sc
->
get_server_name
())
+
20
)
*
sizeof
(
char
));
if
(
!
cs
)
return
NDB_INVALID_SOCKET
;
d
=
true
;
return
NDB_INVALID_SOCKET
;
}
else
cs
=
&
c
[
0
];
snprintf
(
cs
,(
d
)
?
strlen
(
sc
->
get_server_name
()
+
20
)
:
sizeof
(
c
),
"%s:%u"
,
sc
->
get_server_name
(),
sc
->
get_port
());
ndb_mgm_set_connectstring
(
h
,
cs
);
/**
* Set connectstring
*/
{
char
c
[
100
];
char
*
cs
=
&
c
[
0
];
int
len
=
strlen
(
sc
->
get_server_name
())
+
20
;
if
(
len
>
sizeof
(
c
)
)
{
/*
* server name is long. malloc enough for it and the port number
*/
cs
=
(
char
*
)
malloc
(
len
*
sizeof
(
char
));
if
(
!
cs
)
{
ndb_mgm_destroy_handle
(
&
h
);
return
NDB_INVALID_SOCKET
;
}
}
snprintf
(
cs
,
len
,
"%s:%u"
,
sc
->
get_server_name
(),
sc
->
get_port
());
ndb_mgm_set_connectstring
(
h
,
cs
);
if
(
cs
!=
&
c
[
0
])
free
(
cs
);
}
if
(
ndb_mgm_connect
(
h
,
0
,
0
,
0
)
<
0
)
{
ndb_mgm_destroy_handle
(
&
h
);
return
NDB_INVALID_SOCKET
;
}
for
(
unsigned
int
i
=
0
;
i
<
m_transporter_interface
.
size
();
i
++
)
ndb_mgm_set_connection_int_parameter
(
h
,
if
(
ndb_mgm_set_connection_int_parameter
(
h
,
get_localNodeId
(),
m_transporter_interface
[
i
].
m_remote_nodeId
,
CFG_CONNECTION_SERVER_PORT
,
m_transporter_interface
[
i
].
m_s_service_port
,
&
mgm_reply
);
if
(
d
)
free
(
cs
);
&
mgm_reply
)
<
0
)
{
ndb_mgm_destroy_handle
(
&
h
);
return
NDB_INVALID_SOCKET
;
}
return
ndb_mgm_convert_to_transporter
(
h
);
}
...
...
ndb/test/run-test/make-html-reports.sh
View file @
b371e8a5
...
...
@@ -154,9 +154,13 @@ do
ts
=
`
time_spec
$time
`
res_txt
=
""
case
$res
in
0
)
pass
;
res_txt
=
"PASSED"
;
res_dir
=
" "
;
;
0
)
pass
;
res_txt
=
"PASSED"
;;
*
)
fail
;
res_txt
=
"FAILED"
;;
esac
if
[
!
-d
"result.
$no
"
]
;
then
res_dir
=
" "
;
fi
total
=
`
expr
$total
+
$time
`
(
...
...
sql/ha_innodb.cc
View file @
b371e8a5
...
...
@@ -1714,6 +1714,26 @@ innobase_close_connection(
** InnoDB database tables
*****************************************************************************/
/********************************************************************
Get the record format from the data dictionary. */
enum
row_type
ha_innobase
::
get_row_type
()
const
/*=============================*/
/* out: ROW_TYPE_REDUNDANT or ROW_TYPE_COMPACT */
{
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
if
(
prebuilt
&&
prebuilt
->
table
)
{
if
(
prebuilt
->
table
->
comp
)
{
return
(
ROW_TYPE_COMPACT
);
}
else
{
return
(
ROW_TYPE_REDUNDANT
);
}
}
ut_ad
(
0
);
return
(
ROW_TYPE_NOT_USED
);
}
/********************************************************************
Gives the file extension of an InnoDB single-table tablespace. */
...
...
sql/ha_innodb.h
View file @
b371e8a5
...
...
@@ -96,6 +96,11 @@ class ha_innobase: public handler
{
}
~
ha_innobase
()
{}
/*
Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
*/
enum
row_type
get_row_type
()
const
;
const
char
*
table_type
()
const
{
return
(
"InnoDB"
);}
const
char
*
index_type
(
uint
key_number
)
{
return
"BTREE"
;
}
...
...
sql/handler.h
View file @
b371e8a5
...
...
@@ -388,6 +388,12 @@ class handler :public Sql_alloc
virtual
ha_rows
estimate_rows_upper_bound
()
{
return
records
+
EXTRA_RECORDS
;
}
/*
Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
*/
virtual
enum
row_type
get_row_type
()
const
{
return
ROW_TYPE_NOT_USED
;
}
virtual
const
char
*
index_type
(
uint
key_number
)
{
DBUG_ASSERT
(
0
);
return
""
;}
int
ha_index_init
(
uint
idx
)
...
...
sql/sql_show.cc
View file @
b371e8a5
...
...
@@ -2048,10 +2048,31 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
tmp_buff
=
file
->
table_type
();
table
->
field
[
4
]
->
store
(
tmp_buff
,
strlen
(
tmp_buff
),
cs
);
table
->
field
[
5
]
->
store
((
longlong
)
share
->
frm_version
);
tmp_buff
=
((
share
->
db_options_in_use
&
HA_OPTION_COMPRESS_RECORD
)
?
"Compressed"
:
(
share
->
db_options_in_use
&
HA_OPTION_PACK_RECORD
)
?
"Dynamic"
:
"Fixed"
);
enum
row_type
row_type
=
file
->
get_row_type
();
switch
(
row_type
)
{
case
ROW_TYPE_NOT_USED
:
case
ROW_TYPE_DEFAULT
:
tmp_buff
=
((
share
->
db_options_in_use
&
HA_OPTION_COMPRESS_RECORD
)
?
"Compressed"
:
(
share
->
db_options_in_use
&
HA_OPTION_PACK_RECORD
)
?
"Dynamic"
:
"Fixed"
);
break
;
case
ROW_TYPE_FIXED
:
tmp_buff
=
"Fixed"
;
break
;
case
ROW_TYPE_DYNAMIC
:
tmp_buff
=
"Dynamic"
;
break
;
case
ROW_TYPE_COMPRESSED
:
tmp_buff
=
"Compressed"
;
break
;
case
ROW_TYPE_REDUNDANT
:
tmp_buff
=
"Redundant"
;
break
;
case
ROW_TYPE_COMPACT
:
tmp_buff
=
"Compact"
;
break
;
}
table
->
field
[
6
]
->
store
(
tmp_buff
,
strlen
(
tmp_buff
),
cs
);
if
(
!
tables
->
schema_table
)
{
...
...
sql/table.cc
View file @
b371e8a5
...
...
@@ -661,6 +661,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
if
(
!
(
field
->
flags
&
BINARY_FLAG
))
keyinfo
->
flags
|=
HA_END_SPACE_KEY
;
}
set_if_bigger
(
share
->
max_key_length
,
keyinfo
->
key_length
);
if
(
field
->
type
()
==
MYSQL_TYPE_BIT
)
key_part
->
key_part_flag
|=
HA_BIT_PART
;
...
...
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