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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d5810cd0
Commit
d5810cd0
authored
Oct 25, 2006
by
stewart@willster.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge willster.(none):/home/stewart/Documents/MySQL/5.0/ndb
into willster.(none):/home/stewart/Documents/MySQL/5.1/ndb
parents
d9d7c785
61f87f5d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
19 deletions
+46
-19
mysql-test/r/ndb_multi.result
mysql-test/r/ndb_multi.result
+0
-1
mysql-test/t/ndb_multi.test
mysql-test/t/ndb_multi.test
+1
-6
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+39
-11
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+6
-1
No files found.
mysql-test/r/ndb_multi.result
View file @
d5810cd0
...
...
@@ -32,7 +32,6 @@ insert into t1 value (2);
select * from t1;
a
2
flush status;
select * from t1;
a
2
...
...
mysql-test/t/ndb_multi.test
View file @
d5810cd0
...
...
@@ -39,12 +39,7 @@ drop table t1;
create
table
t1
(
a
int
)
engine
=
ndbcluster
;
insert
into
t1
value
(
2
);
connection
server1
;
## Currently a retry is required remotely
#--error 1412
#select * from t1;
#show warnings;
#flush table t1;
# Table definition change should be propagated automatically
select
*
from
t1
;
select
*
from
t1
;
# Connect to server2 and use the tables from there
...
...
sql/ha_ndbcluster.cc
View file @
d5810cd0
...
...
@@ -152,8 +152,7 @@ static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length,
static
int
rename_share
(
NDB_SHARE
*
share
,
const
char
*
new_key
);
#endif
static
void
ndb_set_fragmentation
(
NDBTAB
&
tab
,
TABLE
*
table
,
uint
pk_len
);
static
int
ndb_get_table_statistics
(
Ndb
*
,
const
NDBTAB
*
,
static
int
ndb_get_table_statistics
(
ha_ndbcluster
*
,
bool
,
Ndb
*
,
const
NDBTAB
*
,
struct
Ndb_statistics
*
);
...
...
@@ -485,7 +484,8 @@ int ha_ndbcluster::records_update()
Ndb
*
ndb
=
get_ndb
();
struct
Ndb_statistics
stat
;
ndb
->
setDatabaseName
(
m_dbname
);
if
((
result
=
ndb_get_table_statistics
(
ndb
,
m_table
,
&
stat
))
==
0
)
result
=
ndb_get_table_statistics
(
this
,
true
,
ndb
,
m_table
,
&
stat
);
if
(
result
==
0
)
{
stats
.
mean_rec_length
=
stat
.
row_size
;
stats
.
data_file_length
=
stat
.
fragment_memory
;
...
...
@@ -497,6 +497,7 @@ int ha_ndbcluster::records_update()
if
(
get_thd_ndb
(
thd
)
->
error
)
info
->
no_uncommitted_rows_count
=
0
;
}
if
(
result
==
0
)
stats
.
records
=
info
->
records
+
info
->
no_uncommitted_rows_count
;
DBUG_RETURN
(
result
);
}
...
...
@@ -3682,7 +3683,8 @@ int ha_ndbcluster::info(uint flag)
struct
Ndb_statistics
stat
;
ndb
->
setDatabaseName
(
m_dbname
);
if
(
current_thd
->
variables
.
ndb_use_exact_count
&&
(
result
=
ndb_get_table_statistics
(
ndb
,
m_table
,
&
stat
))
==
0
)
(
result
=
ndb_get_table_statistics
(
this
,
true
,
ndb
,
m_table
,
&
stat
))
==
0
)
{
stats
.
mean_rec_length
=
stat
.
row_size
;
stats
.
data_file_length
=
stat
.
fragment_memory
;
...
...
@@ -5754,7 +5756,15 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
res
=
get_metadata
(
name
);
if
(
!
res
)
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
{
Ndb
*
ndb
=
get_ndb
();
ndb
->
setDatabaseName
(
m_dbname
);
struct
Ndb_statistics
stat
;
res
=
ndb_get_table_statistics
(
NULL
,
false
,
ndb
,
m_tabname
,
&
stat
);
records
=
stat
.
row_count
;
if
(
!
res
)
res
=
info
(
HA_STATUS_CONST
);
}
#ifdef HAVE_NDB_BINLOG
if
(
!
ndb_binlog_tables_inited
&&
ndb_binlog_running
)
...
...
@@ -6980,7 +6990,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
{
Ndb_table_guard
ndbtab_g
(
ndb
->
getDictionary
(),
tabname
);
if
(
ndbtab_g
.
get_table
()
==
0
||
ndb_get_table_statistics
(
ndb
,
ndbtab_g
.
get_table
(),
&
stat
))
||
ndb_get_table_statistics
(
NULL
,
false
,
ndb
,
ndbtab_g
.
get_table
(),
&
stat
))
{
free_share
(
&
share
);
DBUG_RETURN
(
1
);
...
...
@@ -7546,12 +7556,13 @@ void ndbcluster_free_share(NDB_SHARE **share, bool have_lock)
static
int
ndb_get_table_statistics
(
Ndb
*
ndb
,
const
NDBTAB
*
ndbtab
,
ndb_get_table_statistics
(
ha_ndbcluster
*
file
,
bool
report_error
,
Ndb
*
ndb
,
const
NDBTAB
*
ndbtab
,
struct
Ndb_statistics
*
ndbstat
)
{
NdbTransaction
*
pTrans
;
NdbError
error
;
int
retries
=
10
;
int
reterr
=
0
;
int
retry_sleep
=
30
*
1000
;
/* 30 milliseconds */
char
buff
[
22
],
buff2
[
22
],
buff3
[
22
],
buff4
[
22
];
DBUG_ENTER
(
"ndb_get_table_statistics"
);
...
...
@@ -7647,6 +7658,22 @@ ndb_get_table_statistics(Ndb* ndb, const NDBTAB *ndbtab,
DBUG_RETURN
(
0
);
retry:
if
(
report_error
)
{
if
(
file
)
{
reterr
=
file
->
ndb_err
(
pTrans
);
}
else
{
const
NdbError
&
tmp
=
error
;
ERR_PRINT
(
tmp
);
reterr
=
ndb_to_mysql_error
(
&
tmp
);
}
}
else
reterr
=
error
.
code
;
if
(
pTrans
)
{
ndb
->
closeTransaction
(
pTrans
);
...
...
@@ -7659,8 +7686,9 @@ retry:
}
break
;
}
while
(
1
);
DBUG_PRINT
(
"exit"
,
(
"failed, error %u(%s)"
,
error
.
code
,
error
.
message
));
ERR_RETURN
(
error
);
DBUG_PRINT
(
"exit"
,
(
"failed, reterr: %u, NdbError %u(%s)"
,
reterr
,
error
.
code
,
error
.
message
));
DBUG_RETURN
(
reterr
);
}
/*
...
...
@@ -8318,7 +8346,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
{
Ndb_table_guard
ndbtab_g
(
ndb
->
getDictionary
(),
share
->
table_name
);
if
(
ndbtab_g
.
get_table
()
&&
ndb_get_table_statistics
(
ndb
,
ndbtab_g
.
get_table
(),
&
stat
)
==
0
)
ndb_get_table_statistics
(
NULL
,
false
,
ndb
,
ndbtab_g
.
get_table
(),
&
stat
)
==
0
)
{
char
buff
[
22
],
buff2
[
22
];
DBUG_PRINT
(
"ndb_util_thread"
,
...
...
sql/ha_ndbcluster.h
View file @
d5810cd0
...
...
@@ -772,6 +772,12 @@ static void set_tabname(const char *pathname, char *tabname);
void
cond_pop
();
uint8
table_cache_type
();
/*
* Internal to ha_ndbcluster, used by C functions
*/
int
ndb_err
(
NdbTransaction
*
);
my_bool
register_query_cache_table
(
THD
*
thd
,
char
*
table_key
,
uint
key_length
,
qc_engine_callback
*
engine_callback
,
...
...
@@ -868,7 +874,6 @@ private:
ulonglong
nb_desired_values
,
ulonglong
*
first_value
,
ulonglong
*
nb_reserved_values
);
int
ndb_err
(
NdbTransaction
*
);
bool
uses_blob_value
();
char
*
update_table_comment
(
const
char
*
comment
);
...
...
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