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
67214a82
Commit
67214a82
authored
Jan 02, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/my/mysql into donna.mysql.com:/home/my/bk/mysql
parents
c799344a
b0fdf940
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
12 deletions
+39
-12
Build-tools/Do-all-build-steps
Build-tools/Do-all-build-steps
+1
-0
Docs/manual.texi
Docs/manual.texi
+10
-1
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+2
-0
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+4
-0
mysql-test/t/bdb.test
mysql-test/t/bdb.test
+8
-0
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+10
-9
sql/ha_berkeley.h
sql/ha_berkeley.h
+4
-2
No files found.
Build-tools/Do-all-build-steps
View file @
67214a82
...
...
@@ -15,6 +15,7 @@ echo "Building on $to_host"
rm
-rf
$BD
/
*
rm
-f
$WD
/binary/
*
mkdir
-p
$WD
/binary
mkdir
-p
$WD
/Logs
mkdir
-p
$BD
/Logs
...
...
Docs/manual.texi
View file @
67214a82
...
...
@@ -8704,7 +8704,16 @@ shell> ./bin/mysql_install_db
shell> ./bin/safe_mysqld --user=mysql &
@end example
This installs and starts @code{MySQL} without any passwords.
This creates the @code{mysql} database which will hold all database
privileges, the @code{test} database which you can use to test
@strong{MySQL} and also privilege entries for the user that run
@code{mysql_install_db} and a @code{root} user (without any passwords).
This also starts the @code{mysqld} server.
@code{mysql_install_db} will not overwrite any old privilege tables, so
it should be safe to run in any circumstances. If you don't want to
have the @code{test} database you can remove it with @code{mysqladmin -u
root drop test}.
Testing is most easily done from the top-level directory of the @strong{MySQL}
distribution. For a binary distribution, this is your installation directory
mysql-test/mysql-test-run.sh
View file @
67214a82
...
...
@@ -286,6 +286,7 @@ start_master()
--pid-file=
$MASTER_MYPID
\
--socket=
$MASTER_MYSOCK
\
--log=
$MASTER_MYLOG
--default-character-set=latin1
\
--core
\
--language=english
$EXTRA_MASTER_OPT
$EXTRA_MASTER_MYSQLD_OPT
"
if
[
x
$DO_DDD
=
x1
]
then
...
...
@@ -327,6 +328,7 @@ start_slave()
--port=
$SLAVE_MYPORT
\
--socket=
$SLAVE_MYSOCK
\
--log=
$SLAVE_MYLOG
--default-character-set=latin1
\
--core
\
--language=english
$EXTRA_SLAVE_OPT
$EXTRA_SLAVE_MYSQLD_OPT
"
if
[
x
$DO_DDD
=
x1
]
then
...
...
mysql-test/r/bdb.result
View file @
67214a82
...
...
@@ -402,3 +402,7 @@ id parent_id level
1180 105 2
count(*)
1
a
1
2
3
mysql-test/t/bdb.test
View file @
67214a82
...
...
@@ -326,3 +326,11 @@ CREATE TABLE t1 (
INSERT
INTO
t1
(
sca_code
,
cat_code
,
sca_desc
,
lan_code
,
sca_pic
,
sca_sdesc
,
sca_sch_desc
)
VALUES
(
'PD'
,
'J'
,
'PENDANT'
,
'EN'
,
NULL
,
NULL
,
'PENDANT'
),(
'RI'
,
'J'
,
'RING'
,
'EN'
,
NULL
,
NULL
,
'RING'
);
select
count
(
*
)
from
t1
where
sca_code
=
'PD'
;
drop
table
t1
;
#
# Test of opening table twice
#
CREATE
TABLE
t1
(
a
int
not
null
,
primary
key
(
a
))
type
=
bdb
;
insert
into
t1
values
(
1
),(
2
),(
3
);
select
t1
.
a
from
t1
natural
join
t1
as
t2
order
by
t1
.
a
;
drop
table
t1
;
sql/ha_berkeley.cc
View file @
67214a82
...
...
@@ -424,7 +424,6 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
if
((
primary_key
=
table
->
primary_key
)
>=
MAX_KEY
)
{
// No primary key
primary_key
=
table
->
keys
;
fixed_length_primary_key
=
1
;
ref_length
=
hidden_primary_key
=
BDB_HIDDEN_PRIMARY_KEY_LENGTH
;
}
key_used_on_scan
=
primary_key
;
...
...
@@ -457,6 +456,7 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
thr_lock_data_init
(
&
share
->
lock
,
&
lock
,(
void
*
)
0
);
key_file
=
share
->
key_file
;
key_type
=
share
->
key_type
;
bzero
((
char
*
)
&
current_row
,
sizeof
(
current_row
));
/* Fill in shared structure, if needed */
pthread_mutex_lock
(
&
share
->
mutex
);
...
...
@@ -489,10 +489,9 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN
(
1
);
}
/* Open other keys */
/* Open other keys
; These are part of the share structure
*/
key_file
[
primary_key
]
=
file
;
key_type
[
primary_key
]
=
DB_NOOVERWRITE
;
bzero
((
char
*
)
&
current_row
,
sizeof
(
current_row
));
DB
**
ptr
=
key_file
;
for
(
uint
i
=
0
,
used_keys
=
0
;
i
<
table
->
keys
;
i
++
,
ptr
++
)
...
...
@@ -522,6 +521,7 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
}
}
/* Calculate pack_length of primary key */
share
->
fixed_length_primary_key
=
1
;
if
(
!
hidden_primary_key
)
{
ref_length
=
0
;
...
...
@@ -529,18 +529,19 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
KEY_PART_INFO
*
end
=
key_part
+
table
->
key_info
[
primary_key
].
key_parts
;
for
(
;
key_part
!=
end
;
key_part
++
)
ref_length
+=
key_part
->
field
->
max_packed_col_length
(
key_part
->
length
);
fixed_length_primary_key
=
share
->
fixed_length_primary_key
=
(
ref_length
==
table
->
key_info
[
primary_key
].
key_length
);
share
->
status
|=
STATUS_PRIMARY_KEY_INIT
;
}
share
->
ref_length
=
ref_length
;
}
ref_length
=
share
->
ref_length
;
// If second open
pthread_mutex_unlock
(
&
share
->
mutex
);
transaction
=
0
;
cursor
=
0
;
key_read
=
0
;
fixed_length_row
=!
(
table
->
db_create_options
&
HA_OPTION_PACK_RECORD
);
share
->
fixed_length_row
=!
(
table
->
db_create_options
&
HA_OPTION_PACK_RECORD
);
get_status
();
info
(
HA_STATUS_NO_LOCK
|
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
...
...
@@ -598,7 +599,7 @@ ulong ha_berkeley::max_row_length(const byte *buf)
int
ha_berkeley
::
pack_row
(
DBT
*
row
,
const
byte
*
record
,
bool
new_row
)
{
bzero
((
char
*
)
row
,
sizeof
(
*
row
));
if
(
fixed_length_row
)
if
(
share
->
fixed_length_row
)
{
row
->
data
=
(
void
*
)
record
;
row
->
size
=
table
->
reclength
+
hidden_primary_key
;
...
...
@@ -640,7 +641,7 @@ int ha_berkeley::pack_row(DBT *row, const byte *record, bool new_row)
void
ha_berkeley
::
unpack_row
(
char
*
record
,
DBT
*
row
)
{
if
(
fixed_length_row
)
if
(
share
->
fixed_length_row
)
memcpy
(
record
,(
char
*
)
row
->
data
,
table
->
reclength
+
hidden_primary_key
);
else
{
...
...
@@ -1486,7 +1487,7 @@ DBT *ha_berkeley::get_pos(DBT *to, byte *pos)
bzero
((
char
*
)
to
,
sizeof
(
*
to
));
to
->
data
=
pos
;
if
(
fixed_length_primary_key
)
if
(
share
->
fixed_length_primary_key
)
to
->
size
=
ref_length
;
else
{
...
...
sql/ha_berkeley.h
View file @
67214a82
...
...
@@ -35,6 +35,8 @@ typedef struct st_berkeley_share {
u_int32_t
*
key_type
;
uint
table_name_length
,
use_count
;
uint
status
,
version
;
uint
ref_length
;
bool
fixed_length_primary_key
,
fixed_length_row
;
}
BDB_SHARE
;
...
...
@@ -55,8 +57,8 @@ class ha_berkeley: public handler
ulong
changed_rows
;
uint
primary_key
,
last_dup_key
,
hidden_primary_key
,
version
;
u_int32_t
lock_on_read
;
bool
fixed_length_row
,
fixed_length_primary_key
,
key_read
,
using_ignore
;
bool
fix_rec_buff_for_blob
(
ulong
length
);
bool
key_read
,
using_ignore
;
bool
fix_rec_buff_for_blob
(
ulong
length
);
byte
current_ident
[
BDB_HIDDEN_PRIMARY_KEY_LENGTH
];
ulong
max_row_length
(
const
byte
*
buf
);
...
...
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