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
17174373
Commit
17174373
authored
Feb 19, 2001
by
tim@threads.polyesthetic.msg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Portability and bug fixes for Innobase.
Add --with-innobase-db to configure.
parent
d25308e4
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
144 additions
and
24 deletions
+144
-24
acconfig.h
acconfig.h
+3
-0
acinclude.m4
acinclude.m4
+77
-0
configure.in
configure.in
+11
-0
innobase/configure.in
innobase/configure.in
+2
-1
innobase/include/lock0types.h
innobase/include/lock0types.h
+1
-0
innobase/include/os0file.h
innobase/include/os0file.h
+6
-0
innobase/include/os0sync.h
innobase/include/os0sync.h
+2
-2
innobase/include/sync0types.h
innobase/include/sync0types.h
+1
-0
innobase/os/os0sync.c
innobase/os/os0sync.c
+20
-7
sql/Makefile.am
sql/Makefile.am
+6
-2
sql/ha_innobase.cc
sql/ha_innobase.cc
+15
-12
No files found.
acconfig.h
View file @
17174373
...
...
@@ -78,6 +78,9 @@
/* Define if int8, int16 and int32 types exist */
#undef HAVE_INT_8_16_32
/* Using Innobase DB */
#undef HAVE_INNOBASE_DB
/* Define if we have GNU readline */
#undef HAVE_LIBREADLINE
...
...
acinclude.m4
View file @
17174373
...
...
@@ -848,6 +848,83 @@ dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_BDB SECTION
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_INNOBASE
dnl Sets HAVE_INNOBASE_DB if --with-innobase-db is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_INNOBASE], [
AC_ARG_WITH([innobase-db],
[\
--with-innobase-db Use Innobase DB],
[innobase="$withval"],
[innobase=no])
AC_MSG_CHECKING([for Innobase DB])
have_innobase_db=no
innobase_includes=
innobase_libs=
case "$innobase" in
yes )
AC_MSG_RESULT([Using Innobase DB])
AC_DEFINE(HAVE_INNOBASE_DB)
have_innobase_db="yes"
innobase_includes="-I../innobase/include"
dnl Some libs are listed several times, in order for gcc to sort out
dnl circular references.
innobase_libs="\
../innobase/usr/libusr.a\
../innobase/odbc/libodbc.a\
../innobase/srv/libsrv.a\
../innobase/que/libque.a\
../innobase/dict/libdict.a\
../innobase/ibuf/libibuf.a\
../innobase/row/librow.a\
../innobase/pars/libpars.a\
../innobase/btr/libbtr.a\
../innobase/trx/libtrx.a\
../innobase/read/libread.a\
../innobase/usr/libusr.a\
../innobase/buf/libbuf.a\
../innobase/ibuf/libibuf.a\
../innobase/eval/libeval.a\
../innobase/log/liblog.a\
../innobase/fsp/libfsp.a\
../innobase/fut/libfut.a\
../innobase/fil/libfil.a\
../innobase/lock/liblock.a\
../innobase/mtr/libmtr.a\
../innobase/page/libpage.a\
../innobase/rem/librem.a\
../innobase/thr/libthr.a\
../innobase/com/libcom.a\
../innobase/sync/libsync.a\
../innobase/data/libdata.a\
../innobase/mach/libmach.a\
../innobase/ha/libha.a\
../innobase/dyn/libdyn.a\
../innobase/mem/libmem.a\
../innobase/sync/libsync.a\
../innobase/ut/libut.a\
../innobase/os/libos.a\
../innobase/ut/libut.a"
AC_CHECK_LIB(rt, aio_read, [innobase_libs="$innobase_libs -lrt"])
;;
* )
AC_MSG_RESULT([Not using Innobase DB])
;;
esac
AC_SUBST(innobase_includes)
AC_SUBST(innobase_libs)
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_INNOBASE SECTION
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Got this from the GNU tar 1.13.11 distribution
dnl by Paul Eggert <eggert@twinsun.com>
...
...
configure.in
View file @
17174373
...
...
@@ -1833,6 +1833,7 @@ AC_MSG_RESULT([default: $default_charset; compiled in: $CHARSETS])
MYSQL_CHECK_BDB
MYSQL_CHECK_INNOBASE
# If we have threads generate some library functions and test programs
...
...
@@ -1898,6 +1899,16 @@ mysql-noinstall-hack:' \
AC_DEFINE(HAVE_BERKELEY_DB)
fi
if test X"$have_innobase_db" = Xyes
then
sql_server_dirs="innobase $sql_server_dirs"
echo "CONFIGURING FOR INNOBASE DB"
(cd innobase && sh ./configure) \
|| AC_MSG_ERROR([could not configure Innobase DB])
echo "END OF INNOBASE DB CONFIGURATION"
fi
if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes"
then
# MIT user level threads
...
...
innobase/configure.in
View file @
17174373
# Process this file with autoconf to produce a configure script
AC_INIT(./os/os0file.c)
AC_INIT
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(ib_config.h)
AM_INIT_AUTOMAKE(ib, 0.90)
AC_PROG_CC
...
...
innobase/include/lock0types.h
View file @
17174373
...
...
@@ -9,6 +9,7 @@ Created 5/7/1996 Heikki Tuuri
#ifndef lock0types_h
#define lock0types_h
#define lock_t ib_lock_t
typedef
struct
lock_struct
lock_t
;
typedef
struct
lock_sys_struct
lock_sys_t
;
...
...
innobase/include/os0file.h
View file @
17174373
...
...
@@ -28,6 +28,12 @@ Created 10/21/1995 Heikki Tuuri
#define POSIX_ASYNC_IO
#endif
#ifndef S_IRWXU
#define S_IRWXU 00700
#define S_IRWXG 00070
#define S_IRWXO 00007
#endif
#endif
#ifdef __WIN__
...
...
innobase/include/os0sync.h
View file @
17174373
...
...
@@ -25,8 +25,8 @@ struct os_event_struct {
fields */
ibool
is_set
;
/* this is TRUE if the next mutex is
not reserved */
os_fast_mutex_t
wait_mutex
;
/* this mutex is used in waiting for
the event */
pthread_cond_t
cond_var
;
/* condition variable is used in
waiting for
the event */
};
typedef
struct
os_event_struct
os_event_struct_t
;
typedef
os_event_struct_t
*
os_event_t
;
...
...
innobase/include/sync0types.h
View file @
17174373
...
...
@@ -9,6 +9,7 @@ Created 9/5/1995 Heikki Tuuri
#ifndef sync0types_h
#define sync0types_h
#define mutex_t ib_mutex_t
typedef
struct
mutex_struct
mutex_t
;
...
...
innobase/os/os0sync.c
View file @
17174373
...
...
@@ -60,9 +60,9 @@ os_event_create(
event
=
ut_malloc
(
sizeof
(
struct
os_event_struct
));
os_fast_mutex_init
(
&
(
event
->
os_mutex
));
os_fast_mutex_init
(
&
(
event
->
wait_mutex
)
);
pthread_cond_init
(
&
(
event
->
cond_var
),
NULL
);
event
->
is_set
=
TRU
E
;
event
->
is_set
=
FALS
E
;
return
(
event
);
#endif
...
...
@@ -119,8 +119,8 @@ os_event_set(
if
(
event
->
is_set
)
{
/* Do nothing */
}
else
{
os_fast_mutex_unlock
(
&
(
event
->
wait_mutex
));
event
->
is_set
=
TRUE
;
pthread_cond_broadcast
(
&
(
event
->
cond_var
));
}
os_fast_mutex_unlock
(
&
(
event
->
os_mutex
));
...
...
@@ -148,7 +148,6 @@ os_event_reset(
if
(
!
event
->
is_set
)
{
/* Do nothing */
}
else
{
os_fast_mutex_lock
(
&
(
event
->
wait_mutex
));
event
->
is_set
=
FALSE
;
}
...
...
@@ -173,7 +172,7 @@ os_event_free(
ut_a
(
event
);
os_fast_mutex_free
(
&
(
event
->
os_mutex
));
os_fast_mutex_free
(
&
(
event
->
wait_mutex
));
pthread_cond_destroy
(
&
(
event
->
cond_var
));
ut_free
(
event
);
#endif
...
...
@@ -197,8 +196,22 @@ os_event_wait(
ut_a
(
err
==
WAIT_OBJECT_0
);
#else
os_fast_mutex_lock
(
&
(
event
->
wait_mutex
));
os_fast_mutex_unlock
(
&
(
event
->
wait_mutex
));
os_fast_mutex_lock
(
&
(
event
->
os_mutex
));
loop:
if
(
event
->
is_set
==
TRUE
)
{
os_fast_mutex_unlock
(
&
(
event
->
os_mutex
));
/* Ok, we may return */
return
;
}
pthread_cond_wait
(
&
(
event
->
cond_var
),
&
(
event
->
os_mutex
));
/* Solaris manual said that spurious wakeups may occur: we have
to check the 'is_set' variable again */
goto
loop
;
#endif
}
...
...
sql/Makefile.am
View file @
17174373
...
...
@@ -20,7 +20,9 @@
MYSQLDATAdir
=
$(localstatedir)
MYSQLSHAREdir
=
$(pkgdatadir)
MYSQLBASEdir
=
$(prefix)
INCLUDES
=
@MT_INCLUDES@ @bdb_includes@
-I
$(srcdir)
/../include
\
INCLUDES
=
@MT_INCLUDES@
\
@bdb_includes@ @innobase_includes@
\
-I
$(srcdir)
/../include
\
-I
$(srcdir)
/../regex
\
-I
$(srcdir)
-I
../include
-I
..
-I
.
WRAPLIBS
=
@WRAPLIBS@
...
...
@@ -37,7 +39,9 @@ LDADD = ../isam/libnisam.a \
../dbug/libdbug.a
\
../regex/libregex.a
\
../strings/libmystrings.a
mysqld_LDADD
=
@MYSQLD_EXTRA_LDFLAGS@ @bdb_libs@
$(LDADD)
$(CXXLDFLAGS)
$(WRAPLIBS)
mysqld_LDADD
=
@MYSQLD_EXTRA_LDFLAGS@
\
@bdb_libs@ @innobase_libs@
\
$(LDADD)
$(CXXLDFLAGS)
$(WRAPLIBS)
noinst_HEADERS
=
item.h item_func.h item_sum.h item_cmpfunc.h
\
item_strfunc.h item_timefunc.h item_uniq.h
\
item_create.h mysql_priv.h
\
...
...
sql/ha_innobase.cc
View file @
17174373
...
...
@@ -1288,9 +1288,9 @@ calc_row_difference(
uint
n_fields
;
ulint
o_len
;
ulint
n_len
;
mysql_byte
*
o_ptr
;
mysql_byte
*
n_ptr
;
mysql_byte
*
buf
;
byte
*
o_ptr
;
byte
*
n_ptr
;
byte
*
buf
;
upd_field_t
*
ufield
;
ulint
col_type
;
ulint
is_unsigned
;
...
...
@@ -1300,7 +1300,7 @@ calc_row_difference(
n_fields
=
table
->
fields
;
/* We use upd_buff to convert changed fields */
buf
=
upd_buff
;
buf
=
(
byte
*
)
upd_buff
;
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
field
=
table
->
field
[
i
];
...
...
@@ -1312,8 +1312,8 @@ calc_row_difference(
goto
skip_field
;
}
o_ptr
=
old_row
+
get_field_offset
(
table
,
field
);
n_ptr
=
new_row
+
get_field_offset
(
table
,
field
);
o_ptr
=
(
byte
*
)
old_row
+
get_field_offset
(
table
,
field
);
n_ptr
=
(
byte
*
)
new_row
+
get_field_offset
(
table
,
field
);
o_len
=
field
->
pack_length
();
n_len
=
field
->
pack_length
();
...
...
@@ -1353,8 +1353,10 @@ calc_row_difference(
ufield
=
uvect
->
fields
+
n_changed
;
buf
=
innobase_convert_and_store_changed_col
(
ufield
,
buf
,
n_ptr
,
n_len
,
col_type
,
buf
=
(
byte
*
)
innobase_convert_and_store_changed_col
(
ufield
,
(
mysql_byte
*
)
buf
,
(
mysql_byte
*
)
n_ptr
,
n_len
,
col_type
,
is_unsigned
);
ufield
->
exp
=
NULL
;
ufield
->
field_no
=
...
...
@@ -1580,7 +1582,7 @@ ha_innobase::index_read(
last_match_mode
=
match_mode
;
ret
=
row_search_for_mysql
(
buf
,
mode
,
prebuilt
,
match_mode
,
0
);
ret
=
row_search_for_mysql
(
(
byte
*
)
buf
,
mode
,
prebuilt
,
match_mode
,
0
);
if
(
ret
==
DB_SUCCESS
)
{
error
=
0
;
...
...
@@ -1690,7 +1692,8 @@ ha_innobase::general_fetch(
DBUG_ENTER
(
"general_fetch"
);
ret
=
row_search_for_mysql
(
buf
,
0
,
prebuilt
,
match_mode
,
direction
);
ret
=
row_search_for_mysql
((
byte
*
)
buf
,
0
,
prebuilt
,
match_mode
,
direction
);
if
(
ret
==
DB_SUCCESS
)
{
error
=
0
;
...
...
@@ -2550,11 +2553,11 @@ ha_innobase::update_table_comment(
char
*
str
=
my_malloc
(
length
+
50
,
MYF
(
0
));
if
(
!
str
)
return
comment
;
return
(
char
*
)
comment
;
sprintf
(
str
,
"%s Innobase free: %lu kB"
,
comment
,
innobase_get_free_space
());
return
str
;
return
((
char
*
)
str
)
;
}
...
...
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