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
40494168
Commit
40494168
authored
23 years ago
by
monty@donna.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test when exeeding file quota on write
Sanity checks when opening MyISAM files
parent
a7ab29a5
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
24 deletions
+75
-24
Docs/manual.texi
Docs/manual.texi
+30
-5
myisam/mi_check.c
myisam/mi_check.c
+1
-1
myisam/mi_open.c
myisam/mi_open.c
+16
-7
myisam/myisamchk.c
myisam/myisamchk.c
+7
-4
mysys/my_chsize.c
mysys/my_chsize.c
+5
-2
mysys/my_seek.c
mysys/my_seek.c
+2
-2
mysys/my_write.c
mysys/my_write.c
+14
-3
No files found.
Docs/manual.texi
View file @
40494168
...
...
@@ -677,6 +677,7 @@ MySQL ODBC Support
Using MySQL with Some Common Programs
* Apache:: Using @strong{MySQL} with Apache
* Borland C++::
Problems and Common Errors
...
...
@@ -18682,7 +18683,7 @@ TRUNCATE table_name
Is in 3.23 and the same thing as @code{DELETE FROM table_name}. @xref{DELETE}.
The differences are:
@
tabl
e @bullet
@
itemiz
e @bullet
@item
Implemented as a drop and re-create of the table, which makes this
much faster when deleting many rows.
...
...
@@ -18695,7 +18696,7 @@ Doesn't return the number of deleted rows.
As long as the table definition file @file{table_name.frm} is
valid, the table can be re-created this way, even if the data or index
files have become corrupted.
@end
tabl
e
@end
itemiz
e
@findex SELECT
@node SELECT, JOIN, TRUNCATE, Reference
...
...
@@ -32332,10 +32333,11 @@ likely it is that we can fix the problem!
@menu
* Apache:: Using @strong{MySQL} with Apache
* Borland C++::
@end menu
@cindex Apache
@node Apache,
, Common programs, Common programs
@node Apache,
Borland C++
, Common programs, Common programs
@section Using MySQL with Apache
The contrib section includes programs that let you authenticate your
...
...
@@ -32358,6 +32360,29 @@ LOAD DATA INFILE '/local/access_log' INTO TABLE table_name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
@end example
@cindex Borland C++ compiler
@node Borland C++, , Apache, Common programs
@section Borland C++
You can compile the @strong{MySQL} windows source with Borland C++ 5.02.
(The windows source includes only projects for Microsoft VC++, for
Borland C++ you have to do the project files yourself).
One known problem with Borland C++ is that it uses a different structure
alignment than VC++. This means that you will run into problems if you
try to use the default @code{libmysql.dll} libraries (that was compiled
with VC++) with Borland C++. You can do one of the following to avoid
this problem.
@itemize @bullet
@item
You can use the static @strong{MySQL} libraries for Borland C++ that you
can find on @uref{http://www.mysql.net/downloads/os-win32.html}.
@item
Only call @code{mysql_init()} with @code{NULL} as an argument, not a
pre-allocated MYSQL struct.
@end itemize
@cindex problems, common errors
@cindex errors, common
@node Problems, Common problems, Common programs, Top
...
...
@@ -37108,7 +37133,7 @@ This will create a thread-safe client library @code{libmysqlclient_r}.
connection. You can let two threads share the same connection as long
as you do the following:
@
tabl
e @bullet
@
itemiz
e @bullet
@item
Two threads can't send a query to the @strong{MySQL} at the same time on
the same connection. In particular, you have to ensure that between a
...
...
@@ -37132,7 +37157,7 @@ threads may query the same connection.
If you program with POSIX threads, you can use
@code{pthread_mutex_lock()} and @code{pthread_mutex_unlock()} to
establish and release a mutex lock.
@end
tabl
e
@end
itemiz
e
You may get some errors because of undefined symbols when linking your
client with @code{mysqlclient_r}. In most cases this is because you haven't
This diff is collapsed.
Click to expand it.
myisam/mi_check.c
View file @
40494168
...
...
@@ -543,7 +543,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if
(
next_page
+
info
->
s
->
blocksize
>
max_length
)
goto
err
;
info
->
state
->
key_file_length
=
(
max_length
&
~
(
my_off_t
)
(
info
->
s
->
blocksize
-
1
));
~
(
my_off_t
)
(
info
->
s
->
blocksize
-
1
));
}
if
(
!
_mi_fetch_keypage
(
info
,
keyinfo
,
next_page
,
temp_buff
,
0
))
{
...
...
This diff is collapsed.
Click to expand it.
myisam/mi_open.c
View file @
40494168
...
...
@@ -185,6 +185,22 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
HA_ERR_CRASHED_ON_REPAIR
:
HA_ERR_CRASHED_ON_USAGE
);
goto
err
;
}
/* sanity check */
if
(
share
->
base
.
keystart
>
65535
||
share
->
base
.
rec_reflength
>
8
)
{
my_errno
=
HA_ERR_CRASHED
;
goto
err
;
}
if
(
share
->
base
.
max_key_length
>
MI_MAX_KEY_BUFF
||
keys
>
MI_MAX_KEY
||
key_parts
>=
MI_MAX_KEY
*
MI_MAX_KEY_SEG
)
{
DBUG_PRINT
(
"error"
,(
"Wrong key info: Max_key_length: %d keys: %d key_parts: %d"
,
share
->
base
.
max_key_length
,
keys
,
key_parts
));
my_errno
=
HA_ERR_UNSUPPORTED
;
goto
err
;
}
/* Correct max_file_length based on length of sizeof_t */
max_data_file_length
=
(
share
->
options
&
(
HA_OPTION_PACK_RECORD
|
HA_OPTION_COMPRESS_RECORD
))
?
...
...
@@ -220,13 +236,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share
->
base
.
max_data_file_length
=
(
my_off_t
)
max_data_file_length
;
share
->
base
.
max_key_file_length
=
(
my_off_t
)
max_key_file_length
;
if
(
share
->
base
.
max_key_length
>
MI_MAX_KEY_BUFF
||
keys
>
MI_MAX_KEY
||
key_parts
>=
MI_MAX_KEY
*
MI_MAX_KEY_SEG
)
{
DBUG_PRINT
(
"error"
,(
"Wrong key info: Max_key_length: %d keys: %d key_parts: %d"
,
share
->
base
.
max_key_length
,
keys
,
key_parts
));
my_errno
=
HA_ERR_UNSUPPORTED
;
goto
err
;
}
if
(
share
->
options
&
HA_OPTION_COMPRESS_RECORD
)
share
->
base
.
max_key_length
+=
2
;
/* For safety */
...
...
This diff is collapsed.
Click to expand it.
myisam/myisamchk.c
View file @
40494168
...
...
@@ -200,7 +200,7 @@ static struct option long_options[] =
static
void
print_version
(
void
)
{
printf
(
"%s Ver 1.4
0
for %s at %s
\n
"
,
my_progname
,
SYSTEM_TYPE
,
printf
(
"%s Ver 1.4
1
for %s at %s
\n
"
,
my_progname
,
SYSTEM_TYPE
,
MACHINE_TYPE
);
}
...
...
@@ -506,6 +506,8 @@ static int myisamchk(MI_CHECK *param, my_string filename)
param
->
error_printed
=
1
;
switch
(
my_errno
)
{
case
HA_ERR_CRASHED
:
mi_check_print_error
(
param
,
"'%s' doesn't have a correct index definition. You need to recreate it before you can do a repair"
,
filename
);
break
;
case
HA_ERR_WRONG_TABLE_DEF
:
mi_check_print_error
(
param
,
"'%s' is not a MyISAM-table"
,
filename
);
break
;
...
...
@@ -1205,9 +1207,10 @@ static int mi_sort_records(MI_CHECK *param,
param
->
temp_filename
);
goto
err
;
}
if
(
filecopy
(
param
,
new_file
,
info
->
dfile
,
0L
,
share
->
pack
.
header_length
,
"datafile-header"
))
goto
err
;
if
(
share
->
pack
.
header_length
)
if
(
filecopy
(
param
,
new_file
,
info
->
dfile
,
0L
,
share
->
pack
.
header_length
,
"datafile-header"
))
goto
err
;
info
->
rec_cache
.
file
=
new_file
;
/* Use this file for cacheing*/
lock_memory
(
param
);
...
...
This diff is collapsed.
Click to expand it.
mysys/my_chsize.c
View file @
40494168
...
...
@@ -44,8 +44,8 @@ int my_chsize(File fd, my_off_t newlength, myf MyFlags)
my_off_t
oldsize
;
char
buff
[
IO_SIZE
];
bzero
(
buff
,
IO_SIZE
);
oldsize
=
my_seek
(
fd
,
0L
,
MY_SEEK_END
,
MYF
(
MY_WME
+
MY_FAE
));
DBUG_PRINT
(
"info"
,(
"old_size: %ld"
,
(
ulong
)
oldsize
));
#ifdef HAVE_FTRUNCATE
if
(
oldsize
>
newlength
)
...
...
@@ -64,9 +64,12 @@ int my_chsize(File fd, my_off_t newlength, myf MyFlags)
if
(
oldsize
>
newlength
)
{
/* Fill diff with null */
VOID
(
my_seek
(
fd
,
newlength
,
MY_SEEK_SET
,
MYF
(
MY_WME
+
MY_FAE
)));
swap
(
long
,
newlength
,
oldsize
);
swap
(
my_off_t
,
newlength
,
oldsize
);
}
#endif
/* Full file with 0 until it's as big as requested */
bzero
(
buff
,
IO_SIZE
);
my_seek
(
fd
,
old_length
,
MY_SEEK_SET
,
MYF
(
MY_WME
+
MY_FAE
));
while
(
newlength
-
oldsize
>
IO_SIZE
)
{
if
(
my_write
(
fd
,(
byte
*
)
buff
,
IO_SIZE
,
MYF
(
MY_NABP
)))
...
...
This diff is collapsed.
Click to expand it.
mysys/my_seek.c
View file @
40494168
...
...
@@ -24,8 +24,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
{
reg1
os_off_t
newpos
;
DBUG_ENTER
(
"my_seek"
);
DBUG_PRINT
(
"my"
,(
"Fd: %d Pos: %lu Whence: %d MyFlags: %d"
,
fd
,
(
ulong
)
pos
,
whence
,
MyFlags
));
DBUG_PRINT
(
"my"
,(
"Fd: %d
Hpos: %lu
Pos: %lu Whence: %d MyFlags: %d"
,
fd
,
(
(
ulonglong
)
pos
)
>>
32
,
(
ulong
)
pos
,
whence
,
MyFlags
));
newpos
=
lseek
(
fd
,
pos
,
whence
);
if
(
newpos
==
(
os_off_t
)
-
1
)
{
...
...
This diff is collapsed.
Click to expand it.
mysys/my_write.c
View file @
40494168
...
...
@@ -41,7 +41,8 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
Count
-=
writenbytes
;
}
my_errno
=
errno
;
DBUG_PRINT
(
"error"
,(
"Write only %d bytes"
,
writenbytes
));
DBUG_PRINT
(
"error"
,(
"Write only %d bytes, error: %d"
,
writenbytes
,
my_errno
));
#ifndef NO_BACKGROUND
#ifdef THREAD
if
(
my_thread_var
->
abort
)
...
...
@@ -56,8 +57,18 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
VOID
(
sleep
(
MY_WAIT_FOR_USER_TO_FIX_PANIC
));
continue
;
}
if
((
writenbytes
==
0
&&
my_errno
==
EINTR
)
||
(
writenbytes
>
0
&&
(
uint
)
writenbytes
!=
(
uint
)
-
1
))
if
(
!
writenbytes
)
{
/* We may come here on an interrupt or if the file quote is exeeded */
if
(
my_errno
==
EINTR
)
continue
;
if
(
!
errors
++
)
/* Retry once */
{
errno
=
EFBIG
;
/* Assume this is the error */
continue
;
}
}
else
if
((
uint
)
writenbytes
!=
(
uint
)
-
1
)
continue
;
/* Retry */
#endif
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
...
...
This diff is collapsed.
Click to expand it.
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