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
063eeb7e
Commit
063eeb7e
authored
Mar 29, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
parents
202ea81c
04e879e7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
4 deletions
+106
-4
innobase/mem/mem0dbg.c
innobase/mem/mem0dbg.c
+1
-1
mysql-test/r/bdb-crash.result
mysql-test/r/bdb-crash.result
+7
-0
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+8
-0
mysql-test/t/bdb-crash.test
mysql-test/t/bdb-crash.test
+12
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+12
-1
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+47
-0
sql/handler.h
sql/handler.h
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+12
-2
sql/sql_table.cc
sql/sql_table.cc
+6
-0
No files found.
innobase/mem/mem0dbg.c
View file @
063eeb7e
...
...
@@ -20,7 +20,7 @@ Protected by mem_hash_mutex above. */
static
ulint
mem_n_created_heaps
=
0
;
static
ulint
mem_n_allocations
=
0
;
static
ulint
mem_total_allocated_memory
=
0
;
static
ulint
mem_current_allocated_memory
=
0
;
ulint
mem_current_allocated_memory
=
0
;
static
ulint
mem_max_allocated_memory
=
0
;
/* Size of the hash table for memory management tracking */
...
...
mysql-test/r/bdb-crash.result
View file @
063eeb7e
...
...
@@ -30,3 +30,10 @@ ChargeID ServiceID ChargeDate ChargeAmount FedTaxes ProvTaxes ChargeStatus Charg
1 1 2001-03-01 1.00 1.00 1.00 New blablabla NULL now
2 1 2001-03-01 1.00 1.00 1.00 New NULL NULL now
drop table t1;
create table t1 (a int) engine=bdb;
set autocommit=0;
insert into t1 values(1);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Operation need committed state
drop table t1;
mysql-test/r/order_by.result
View file @
063eeb7e
...
...
@@ -546,3 +546,11 @@ CREATE TABLE t1 (a INT, b INT);
SET @id=0;
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
DROP TABLE t1;
create table t1(id int not null auto_increment primary key, t char(12));
explain select id,t from t1 order by id;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 1000 Using filesort
explain select id,t from t1 force index (primary) order by id;
table type possible_keys key key_len ref rows Extra
t1 index NULL PRIMARY 4 NULL 1000
drop table t1;
mysql-test/t/bdb-crash.test
View file @
063eeb7e
...
...
@@ -34,3 +34,15 @@ INSERT INTO t1
VALUES
(
NULL
,
1
,
'2001-03-01'
,
1
,
1
,
1
,
'New'
,
NULL
,
NULL
,
'now'
);
select
*
from
t1
;
drop
table
t1
;
#
# Test for bug #2342 "Running ANALYZE TABLE on bdb table
# inside a transaction hangs server thread"
#
create
table
t1
(
a
int
)
engine
=
bdb
;
set
autocommit
=
0
;
insert
into
t1
values
(
1
);
analyze
table
t1
;
drop
table
t1
;
mysql-test/t/order_by.test
View file @
063eeb7e
...
...
@@ -352,4 +352,15 @@ CREATE TABLE t1 (a INT, b INT);
SET
@
id
=
0
;
UPDATE
t1
SET
a
=
0
ORDER
BY
(
a
=@
id
),
b
;
DROP
TABLE
t1
;
create
table
t1
(
id
int
not
null
auto_increment
primary
key
,
t
char
(
12
));
disable_query_log
;
let
$
1
=
1000
;
while
(
$
1
)
{
eval
insert
into
t1
(
t
)
values
(
'$1'
);
dec
$
1
;
}
enable_query_log
;
explain
select
id
,
t
from
t1
order
by
id
;
explain
select
id
,
t
from
t1
force
index
(
primary
)
order
by
id
;
drop
table
t1
;
\ No newline at end of file
sql/ha_berkeley.cc
View file @
063eeb7e
...
...
@@ -2099,6 +2099,53 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
{
DB_BTREE_STAT
*
stat
=
0
;
uint
i
;
DB_TXN_STAT
*
txn_stat_ptr
=
0
;
/*
Original bdb documentation says:
"The DB->stat method cannot be transaction-protected.
For this reason, it should be called in a thread of
control that has no open cursors or active transactions."
So, let's check if there are any changes have been done since
the beginning of the transaction..
*/
/*
If it's a merge conflict here (4.0->4.1), please ignore it!
The reason of the conflict is the difference between versions of bdb:
mysql-4.0 uses bdb 3.2.9
mysql-4.1 uses bdb 4.1.24
Older one has global functions txn_stat and txn_id but
newer one has DB_ENV->txn_stat and DB_TXN->id
*/
if
(
!
txn_stat
(
db_env
,
&
txn_stat_ptr
,
0
)
&&
txn_stat_ptr
&&
txn_stat_ptr
->
st_nactive
>=
2
)
{
DB_TXN_ACTIVE
*
atxn_stmt
=
0
,
*
atxn_all
=
0
;
DB_TXN
*
txn_all
=
(
DB_TXN
*
)
thd
->
transaction
.
all
.
bdb_tid
;
u_int32_t
all_id
=
txn_id
(
txn_all
);
DB_TXN
*
txn_stmt
=
(
DB_TXN
*
)
thd
->
transaction
.
stmt
.
bdb_tid
;
u_int32_t
stmt_id
=
txn_id
(
txn_stmt
);
DB_TXN_ACTIVE
*
cur
=
txn_stat_ptr
->
st_txnarray
;
DB_TXN_ACTIVE
*
end
=
cur
+
txn_stat_ptr
->
st_nactive
;
for
(;
cur
!=
end
&&
(
!
atxn_stmt
||
!
atxn_all
);
cur
++
)
{
if
(
cur
->
txnid
==
all_id
)
atxn_all
=
cur
;
if
(
cur
->
txnid
==
stmt_id
)
atxn_stmt
=
cur
;
}
if
(
atxn_stmt
&&
atxn_all
&&
log_compare
(
&
atxn_stmt
->
lsn
,
&
atxn_all
->
lsn
))
{
free
(
txn_stat_ptr
);
return
HA_ADMIN_REJECT
;
}
free
(
txn_stat_ptr
);
}
for
(
i
=
0
;
i
<
table
->
keys
;
i
++
)
{
...
...
sql/handler.h
View file @
063eeb7e
...
...
@@ -40,6 +40,7 @@
#define HA_ADMIN_CORRUPT -3
#define HA_ADMIN_INTERNAL_ERROR -4
#define HA_ADMIN_INVALID -5
#define HA_ADMIN_REJECT -6
/* Bits in table_flags() to show what database can do */
#define HA_READ_RND_SAME 1
/* Read RND-record to KEY-record
...
...
sql/sql_select.cc
View file @
063eeb7e
...
...
@@ -6021,7 +6021,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
/* check if we can use a key to resolve the group */
/* Tables using JT_NEXT are handled here */
uint
nr
;
key_map
keys
=
usable_keys
;
key_map
keys
_to_use
=~
0
,
keys
=
usable_keys
;
/*
If not used with LIMIT, only use keys if the whole query can be
...
...
@@ -6029,7 +6029,17 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
retrieving all rows through an index.
*/
if
(
select_limit
>=
table
->
file
->
records
)
keys
&=
(
table
->
used_keys
|
table
->
file
->
keys_to_use_for_scanning
());
keys_to_use
=
(
table
->
used_keys
|
table
->
file
->
keys_to_use_for_scanning
());
/*
We are adding here also the index speified in FORCE INDEX clause,
if any.
This is to allow users to use index in ORDER BY.
*/
if
(
table
->
force_index
)
keys_to_use
|=
table
->
keys_in_use_for_query
;
keys
&=
keys_to_use
;
for
(
nr
=
0
;
keys
;
keys
>>=
1
,
nr
++
)
{
...
...
sql/sql_table.cc
View file @
063eeb7e
...
...
@@ -1330,6 +1330,12 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
net_store_data
(
packet
,
"Operation failed"
);
break
;
case
HA_ADMIN_REJECT
:
net_store_data
(
packet
,
"status"
);
net_store_data
(
packet
,
"Operation need committed state"
);
open_for_modify
=
false
;
break
;
case
HA_ADMIN_ALREADY_DONE
:
net_store_data
(
packet
,
"status"
);
net_store_data
(
packet
,
"Table is already up to date"
);
...
...
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