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
51e5344d
Commit
51e5344d
authored
Mar 12, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
parents
e68fba32
fef194fc
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
132 additions
and
26 deletions
+132
-26
dbug/dbug.c
dbug/dbug.c
+0
-1
myisam/mi_open.c
myisam/mi_open.c
+16
-2
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+1
-1
mysys/default.c
mysys/default.c
+17
-2
mysys/my_lib.c
mysys/my_lib.c
+1
-1
netware/mysqld_safe.c
netware/mysqld_safe.c
+52
-2
sql/field.cc
sql/field.cc
+25
-0
sql/field.h
sql/field.h
+2
-1
sql/mysqld.cc
sql/mysqld.cc
+1
-1
sql/slave.cc
sql/slave.cc
+5
-11
sql/sql_class.cc
sql/sql_class.cc
+2
-0
sql/sql_insert.cc
sql/sql_insert.cc
+2
-3
sql/sql_parse.cc
sql/sql_parse.cc
+3
-0
sql/sql_select.cc
sql/sql_select.cc
+5
-1
No files found.
dbug/dbug.c
View file @
51e5344d
...
...
@@ -919,7 +919,6 @@ void _db_doprnt_ (const char *format,...)
}
(
void
)
fprintf
(
_db_fp_
,
"%s: "
,
state
->
u_keyword
);
(
void
)
vfprintf
(
_db_fp_
,
format
,
args
);
va_end
(
args
);
(
void
)
fputc
(
'\n'
,
_db_fp_
);
dbug_flush
(
state
);
errno
=
save_errno
;
...
...
myisam/mi_open.c
View file @
51e5344d
...
...
@@ -35,6 +35,14 @@ static void setup_key_functions(MI_KEYDEF *keyinfo);
pos+=size;}
#define disk_pos_assert(pos, end_pos) \
if (pos > end_pos) \
{ \
my_errno=HA_ERR_CRASHED; \
goto err; \
}
/******************************************************************************
** Return the shared struct if the table is already open.
** In MySQL the server will handle version issues.
...
...
@@ -70,7 +78,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts
,
unique_key_parts
,
tmp_length
,
uniques
;
char
name_buff
[
FN_REFLEN
],
org_name
[
FN_REFLEN
],
index_name
[
FN_REFLEN
],
data_name
[
FN_REFLEN
];
char
*
disk_cache
,
*
disk
_pos
;
char
*
disk_cache
,
*
disk_pos
,
*
end
_pos
;
MI_INFO
info
,
*
m_info
,
*
old_info
;
MYISAM_SHARE
share_buff
,
*
share
;
ulong
rec_per_key_part
[
MI_MAX_POSSIBLE_KEY
*
MI_MAX_KEY_SEG
];
...
...
@@ -138,11 +146,12 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
info_length
=
mi_uint2korr
(
share
->
state
.
header
.
header_length
);
base_pos
=
mi_uint2korr
(
share
->
state
.
header
.
base_pos
);
if
(
!
(
disk_cache
=
(
char
*
)
my_alloca
(
info_length
)))
if
(
!
(
disk_cache
=
(
char
*
)
my_alloca
(
info_length
+
128
)))
{
my_errno
=
ENOMEM
;
goto
err
;
}
end_pos
=
disk_cache
+
info_length
;
errpos
=
2
;
VOID
(
my_seek
(
kfile
,
0L
,
MY_SEEK_SET
,
MYF
(
0
)));
...
...
@@ -288,6 +297,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
keys
;
i
++
)
{
disk_pos
=
mi_keydef_read
(
disk_pos
,
&
share
->
keyinfo
[
i
]);
disk_pos_assert
(
disk_pos
+
share
->
keyinfo
[
i
].
keysegs
*
MI_KEYSEG_SIZE
,
end_pos
);
set_if_smaller
(
share
->
blocksize
,
share
->
keyinfo
[
i
].
block_length
);
share
->
keyinfo
[
i
].
seg
=
pos
;
for
(
j
=
0
;
j
<
share
->
keyinfo
[
i
].
keysegs
;
j
++
,
pos
++
)
...
...
@@ -319,6 +330,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
uniques
;
i
++
)
{
disk_pos
=
mi_uniquedef_read
(
disk_pos
,
&
share
->
uniqueinfo
[
i
]);
disk_pos_assert
(
disk_pos
+
share
->
uniqueinfo
[
i
].
keysegs
*
MI_KEYSEG_SIZE
,
end_pos
);
share
->
uniqueinfo
[
i
].
seg
=
pos
;
for
(
j
=
0
;
j
<
share
->
uniqueinfo
[
i
].
keysegs
;
j
++
,
pos
++
)
{
...
...
@@ -344,6 +357,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
keys
;
i
++
)
setup_key_functions
(
share
->
keyinfo
+
i
);
disk_pos_assert
(
disk_pos
+
share
->
base
.
fields
*
MI_COLUMNDEF_SIZE
,
end_pos
);
for
(
i
=
j
=
offset
=
0
;
i
<
share
->
base
.
fields
;
i
++
)
{
disk_pos
=
mi_recinfo_read
(
disk_pos
,
&
share
->
rec
[
i
]);
...
...
mysql-test/mysql-test-run.sh
View file @
51e5344d
...
...
@@ -330,7 +330,7 @@ while test $# -gt 0; do
USE_RUNNING_SERVER
=
""
;;
--valgrind
)
VALGRIND
=
"valgrind --alignment=8 --leak-check=yes"
VALGRIND
=
"valgrind --alignment=8 --leak-check=yes
--num-callers=16
"
EXTRA_MASTER_MYSQLD_OPT
=
"
$EXTRA_MASTER_MYSQLD_OPT
--skip-safemalloc"
EXTRA_SLAVE_MYSQLD_OPT
=
"
$EXTRA_SLAVE_MYSQLD_OPT
--skip-safemalloc"
SLEEP_TIME_AFTER_RESTART
=
10
...
...
mysys/default.c
View file @
51e5344d
...
...
@@ -38,6 +38,7 @@
#include "mysys_priv.h"
#include "m_string.h"
#include "m_ctype.h"
#include <my_dir.h>
char
*
defaults_extra_file
=
0
;
...
...
@@ -61,13 +62,13 @@ DATADIR,
NullS
,
};
#define default_ext
".cnf"
/* extension for config file */
#define default_ext ".cnf"
/* extension for config file */
#ifdef __WIN__
#include <winbase.h>
#define windows_ext ".ini"
#endif
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
ext
,
TYPELIB
*
group
);
...
...
@@ -242,6 +243,20 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
{
strmov
(
name
,
config_file
);
}
fn_format
(
name
,
name
,
""
,
""
,
4
);
#if !defined(__WIN__) && !defined(OS2)
{
MY_STAT
stat_info
;
if
(
!
my_stat
(
name
,
&
stat_info
,
MYF
(
0
)))
return
0
;
if
(
stat_info
.
st_mode
&
S_IWOTH
)
/* ignore world-writeable files */
{
fprintf
(
stderr
,
"warning: World-writeable config file %s is ignored
\n
"
,
name
);
return
0
;
}
}
#endif
if
(
!
(
fp
=
my_fopen
(
fn_format
(
name
,
name
,
""
,
""
,
4
),
O_RDONLY
,
MYF
(
0
))))
return
0
;
/* Ignore wrong files */
...
...
mysys/my_lib.c
View file @
51e5344d
...
...
@@ -103,7 +103,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
char
dirent_tmp
[
sizeof
(
struct
dirent
)
+
_POSIX_PATH_MAX
+
1
];
#endif
DBUG_ENTER
(
"my_dir"
);
DBUG_PRINT
(
"my"
,(
"path: '%s'
stat: %d
MyFlags: %d"
,
path
,
MyFlags
));
DBUG_PRINT
(
"my"
,(
"path: '%s' MyFlags: %d"
,
path
,
MyFlags
));
#if defined(THREAD) && !defined(HAVE_READDIR_R)
pthread_mutex_lock
(
&
THR_LOCK_open
);
...
...
netware/mysqld_safe.c
View file @
51e5344d
...
...
@@ -36,6 +36,7 @@
******************************************************************************/
char
autoclose
;
char
basedir
[
PATH_MAX
];
char
checktables
;
char
datadir
[
PATH_MAX
];
char
pid_file
[
PATH_MAX
];
char
address
[
PATH_MAX
];
...
...
@@ -54,6 +55,7 @@ FILE *log_fd = NULL;
******************************************************************************/
void
usage
(
void
);
void
vlog
(
char
*
,
va_list
);
void
log
(
char
*
,
...);
void
start_defaults
(
int
,
char
*
[]);
...
...
@@ -74,6 +76,42 @@ void mysql_start(int, char*[]);
/******************************************************************************
usage()
Show usage.
******************************************************************************/
void
usage
(
void
)
{
// keep the screen up
setscreenmode
(
SCR_NO_MODE
);
puts
(
"\
\n
\
usage: mysqld_safe [options]
\n
\
\n
\
Program to start the MySQL daemon and restart it if it dies unexpectedly.
\n
\
All options, besides those listed below, are passed on to the MySQL daemon.
\n
\
\n
\
options:
\n
\
\n
\
--autoclose Automatically close the mysqld_safe screen.
\n
\
\n
\
--check-tables Check the tables before starting the MySQL daemon.
\n
\
\n
\
--err-log=<file> Send the MySQL daemon error output to <file>.
\n
\
\n
\
--help Show this help information.
\n
\
\n
\
--mysqld=<file> Use the <file> MySQL daemon.
\n
\
\n
\
"
);
exit
(
-
1
);
}
/******************************************************************************
vlog()
Log the message.
...
...
@@ -136,6 +174,9 @@ void start_defaults(int argc, char *argv[])
// basedir
get_basedir
(
argv
[
0
],
basedir
);
// check-tables
checktables
=
FALSE
;
// hostname
if
(
gethostname
(
hostname
,
PATH_MAX
)
<
0
)
{
...
...
@@ -279,13 +320,15 @@ void parse_args(int argc, char *argv[])
OPT_PORT
,
OPT_ERR_LOG
,
OPT_SAFE_LOG
,
OPT_MYSQLD
OPT_MYSQLD
,
OPT_HELP
};
static
struct
option
options
[]
=
{
{
"autoclose"
,
no_argument
,
&
autoclose
,
TRUE
},
{
"basedir"
,
required_argument
,
0
,
OPT_BASEDIR
},
{
"check-tables"
,
no_argument
,
&
checktables
,
TRUE
},
{
"datadir"
,
required_argument
,
0
,
OPT_DATADIR
},
{
"pid-file"
,
required_argument
,
0
,
OPT_PID_FILE
},
{
"bind-address"
,
required_argument
,
0
,
OPT_BIND_ADDRESS
},
...
...
@@ -293,6 +336,7 @@ void parse_args(int argc, char *argv[])
{
"err-log"
,
required_argument
,
0
,
OPT_ERR_LOG
},
{
"safe-log"
,
required_argument
,
0
,
OPT_SAFE_LOG
},
{
"mysqld"
,
required_argument
,
0
,
OPT_MYSQLD
},
{
"help"
,
no_argument
,
0
,
OPT_HELP
},
{
0
,
0
,
0
,
0
}
};
...
...
@@ -341,6 +385,10 @@ void parse_args(int argc, char *argv[])
strcpy
(
mysqld
,
optarg
);
break
;
case
OPT_HELP
:
usage
();
break
;
default:
// ignore
break
;
...
...
@@ -563,6 +611,8 @@ void mysql_start(int argc, char *argv[])
static
char
*
private_options
[]
=
{
"--autoclose"
,
"--check-tables"
,
"--help"
,
"--err-log="
,
"--mysqld="
,
NULL
...
...
@@ -594,7 +644,7 @@ void mysql_start(int argc, char *argv[])
do
{
// check the database tables
check_tables
();
if
(
checktables
)
check_tables
();
// status
time
(
&
cal
);
...
...
sql/field.cc
View file @
51e5344d
...
...
@@ -2421,6 +2421,14 @@ void Field_double::sql_type(String &res) const
** by handler.cc. The form->timestamp points at the automatic timestamp.
****************************************************************************/
enum
Item_result
Field_timestamp
::
result_type
()
const
{
return
(
!
current_thd
->
variables
.
new_mode
&&
(
field_length
==
8
||
field_length
==
14
)
?
INT_RESULT
:
STRING_RESULT
);
}
Field_timestamp
::
Field_timestamp
(
char
*
ptr_arg
,
uint32
len_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
...
...
@@ -2783,6 +2791,23 @@ void Field_timestamp::set_time()
longstore
(
ptr
,
tmp
);
}
/*
This is an exact copy of Field_num except that 'length' is depending
on --new mode
*/
void
Field_timestamp
::
make_field
(
Send_field
*
field
)
{
field
->
table_name
=
table_name
;
field
->
col_name
=
field_name
;
/* If --new, then we are using "YYYY-MM-DD HH:MM:SS" format */
field
->
length
=
current_thd
->
variables
.
new_mode
?
19
:
field_length
;
field
->
type
=
type
();
field
->
flags
=
table
->
maybe_null
?
(
flags
&
~
NOT_NULL_FLAG
)
:
flags
;
field
->
decimals
=
dec
;
}
/****************************************************************************
** time type
** In string context: HH:MM:SS
...
...
sql/field.h
View file @
51e5344d
...
...
@@ -541,7 +541,7 @@ public:
Field_timestamp
(
char
*
ptr_arg
,
uint32
len_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
);
enum
Item_result
result_type
()
const
{
return
field_length
==
8
||
field_length
==
14
?
INT_RESULT
:
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
;
enum_field_types
type
()
const
{
return
FIELD_TYPE_TIMESTAMP
;}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONG_INT
;
}
void
store
(
const
char
*
to
,
uint
length
);
...
...
@@ -575,6 +575,7 @@ public:
void
fill_and_store
(
char
*
from
,
uint
len
);
bool
get_date
(
TIME
*
ltime
,
bool
fuzzydate
);
bool
get_time
(
TIME
*
ltime
);
void
make_field
(
Send_field
*
field
);
};
...
...
sql/mysqld.cc
View file @
51e5344d
...
...
@@ -4225,7 +4225,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if
(
!
mysqld_user
)
mysqld_user
=
argument
;
else
fprintf
(
stderr
,
"Warning: Ignoring user change to '%s' beca
sue the user i
s set to '%s' earlier on the command line
\n
"
,
argument
,
mysqld_user
);
fprintf
(
stderr
,
"Warning: Ignoring user change to '%s' beca
use the user wa
s set to '%s' earlier on the command line
\n
"
,
argument
,
mysqld_user
);
break
;
case
'L'
:
strmake
(
language
,
argument
,
sizeof
(
language
)
-
1
);
...
...
sql/slave.cc
View file @
51e5344d
...
...
@@ -401,9 +401,9 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
DBUG_PRINT
(
"info"
,(
"Terminating IO thread"
));
mi
->
abort_slave
=
1
;
if
((
error
=
terminate_slave_thread
(
mi
->
io_thd
,
io_lock
,
io_cond_lock
,
&
mi
->
stop_cond
,
&
mi
->
slave_running
))
&&
io_cond_lock
,
&
mi
->
stop_cond
,
&
mi
->
slave_running
))
&&
!
force_all
)
DBUG_RETURN
(
error
);
}
...
...
@@ -443,12 +443,10 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
be referening freed memory trying to kick it
*/
THD_CHECK_SENTRY
(
thd
);
if
(
*
slave_running
)
while
(
*
slave_running
)
// Should always be true
{
KICK_SLAVE
(
thd
);
}
while
(
*
slave_running
)
{
/*
There is a small chance that slave thread might miss the first
alarm. To protect againts it, resend the signal until it reacts
...
...
@@ -456,10 +454,6 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
struct
timespec
abstime
;
set_timespec
(
abstime
,
2
);
pthread_cond_timedwait
(
term_cond
,
cond_lock
,
&
abstime
);
if
(
*
slave_running
)
{
KICK_SLAVE
(
thd
);
}
}
if
(
term_lock
)
pthread_mutex_unlock
(
term_lock
);
...
...
sql/sql_class.cc
View file @
51e5344d
...
...
@@ -419,12 +419,14 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length)
#ifdef SIGNAL_WITH_VIO_CLOSE
void
THD
::
close_active_vio
()
{
DBUG_ENTER
(
"close_active_vio"
);
safe_mutex_assert_owner
(
&
LOCK_delete
);
if
(
active_vio
)
{
vio_close
(
active_vio
);
active_vio
=
0
;
}
DBUG_RETURN
;
}
#endif
...
...
sql/sql_insert.cc
View file @
51e5344d
...
...
@@ -139,9 +139,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
*/
if
((
lock_type
==
TL_WRITE_DELAYED
&&
((
specialflag
&
(
SPECIAL_NO_NEW_FUNC
|
SPECIAL_SAFE_MODE
))
||
thd
->
slave_thread
))
||
(
lock_type
==
TL_WRITE_CONCURRENT_INSERT
&&
duplic
==
DUP_REPLACE
)
||
!
max_insert_delayed_threads
)
thd
->
slave_thread
||
!
max_insert_delayed_threads
))
||
(
lock_type
==
TL_WRITE_CONCURRENT_INSERT
&&
duplic
==
DUP_REPLACE
))
lock_type
=
TL_WRITE
;
if
(
lock_type
==
TL_WRITE_DELAYED
)
...
...
sql/sql_parse.cc
View file @
51e5344d
...
...
@@ -1595,6 +1595,7 @@ mysql_execute_command(void)
for
(
table
=
tables
->
next
;
table
;
table
=
table
->
next
)
table
->
lock_type
=
lex
->
lock_option
;
}
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
thd
->
offset_limit
=
select_lex
->
offset_limit
;
thd
->
select_limit
=
select_lex
->
select_limit
+
select_lex
->
offset_limit
;
if
(
thd
->
select_limit
<
select_lex
->
select_limit
)
...
...
@@ -1928,6 +1929,8 @@ mysql_execute_command(void)
if
((
res
=
check_table_access
(
thd
,
SELECT_ACL
,
save_next
)))
goto
error
;
}
/* Don't unlock tables until command is written to binary log */
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
select_result
*
result
;
thd
->
offset_limit
=
select_lex
->
offset_limit
;
...
...
sql/sql_select.cc
View file @
51e5344d
...
...
@@ -4469,7 +4469,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
error
=
0
;
if
(
!
table
)
// If sending data to client
{
join_free
(
join
);
// Unlock all cursors
/*
The following will unlock all cursors if the command wasn't an
update command
*/
join_free
(
join
);
if
(
join
->
result
->
send_eof
())
error
=
1
;
// Don't send error
}
...
...
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