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
c9d04284
Commit
c9d04284
authored
Apr 03, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
38cd4fde
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
352 additions
and
120 deletions
+352
-120
client/mysql.cc
client/mysql.cc
+249
-59
client/mysqldump.c
client/mysqldump.c
+18
-15
client/mysqlimport.c
client/mysqlimport.c
+11
-0
myisam/myisamchk.c
myisam/myisamchk.c
+74
-46
No files found.
client/mysql.cc
View file @
c9d04284
This diff is collapsed.
Click to expand it.
client/mysqldump.c
View file @
c9d04284
...
@@ -228,17 +228,13 @@ static struct my_option my_long_options[] =
...
@@ -228,17 +228,13 @@ static struct my_option my_long_options[] =
MALLOC_OVERHEAD
,
1024
,
0
},
MALLOC_OVERHEAD
,
1024
,
0
},
{
"net_buffer_length"
,
OPT_NET_BUFFER_LENGTH
,
""
,
{
"net_buffer_length"
,
OPT_NET_BUFFER_LENGTH
,
""
,
(
gptr
*
)
&
net_buffer_length
,
(
gptr
*
)
&
net_buffer_length
,
0
,
(
gptr
*
)
&
net_buffer_length
,
(
gptr
*
)
&
net_buffer_length
,
0
,
GET_LONG
,
REQUIRED_ARG
,
1024
*
1024L
-
1025
,
4096
,
512
*
1024L
*
1024L
,
GET_LONG
,
REQUIRED_ARG
,
1024
*
1024L
-
1025
,
4096
,
16
*
1024L
*
1024L
,
MALLOC_OVERHEAD
,
1024
,
0
},
MALLOC_OVERHEAD
-
1024
,
1024
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
};
static
const
char
*
load_default_groups
[]
=
{
"mysqldump"
,
"client"
,
0
};
static
const
char
*
load_default_groups
[]
=
{
"mysqldump"
,
"client"
,
0
};
CHANGEABLE_VAR
md_changeable_vars
[]
=
{
{
0
,
0
,
0
,
0
,
0
,
0
,
0
}
};
static
void
safe_exit
(
int
error
);
static
void
safe_exit
(
int
error
);
static
void
write_header
(
FILE
*
sql_file
,
char
*
db_name
);
static
void
write_header
(
FILE
*
sql_file
,
char
*
db_name
);
static
void
print_value
(
FILE
*
file
,
MYSQL_RES
*
result
,
MYSQL_ROW
row
,
static
void
print_value
(
FILE
*
file
,
MYSQL_RES
*
result
,
MYSQL_ROW
row
,
...
@@ -601,7 +597,7 @@ static uint getTableStructure(char *table, char* db)
...
@@ -601,7 +597,7 @@ static uint getTableStructure(char *table, char* db)
/* Make an sql-file, if path was given iow. option -T was given */
/* Make an sql-file, if path was given iow. option -T was given */
char
buff
[
20
+
FN_REFLEN
];
char
buff
[
20
+
FN_REFLEN
];
sprintf
(
buff
,
"show create table
%s"
,
table_nam
e
);
sprintf
(
buff
,
"show create table
`%s`"
,
tabl
e
);
if
(
mysql_query
(
sock
,
buff
))
if
(
mysql_query
(
sock
,
buff
))
{
{
fprintf
(
stderr
,
"%s: Can't get CREATE TABLE for table '%s' (%s)
\n
"
,
fprintf
(
stderr
,
"%s: Can't get CREATE TABLE for table '%s' (%s)
\n
"
,
...
@@ -847,8 +843,6 @@ static uint getTableStructure(char *table, char* db)
...
@@ -847,8 +843,6 @@ static uint getTableStructure(char *table, char* db)
fputs
(
";
\n
"
,
sql_file
);
fputs
(
";
\n
"
,
sql_file
);
}
}
}
}
if
(
opt_disable_keys
)
fprintf
(
sql_file
,
"
\n
/*!40000 ALTER TABLE %s DISABLE KEYS */;
\n
"
,
table_name
);
if
(
cFlag
)
if
(
cFlag
)
{
{
strpos
=
strmov
(
strpos
,
") VALUES "
);
strpos
=
strmov
(
strpos
,
") VALUES "
);
...
@@ -973,7 +967,7 @@ static void dumpTable(uint numFields, char *table)
...
@@ -973,7 +967,7 @@ static void dumpTable(uint numFields, char *table)
strxmov
(
strend
(
query
),
" WHERE "
,
where
,
NullS
);
strxmov
(
strend
(
query
),
" WHERE "
,
where
,
NullS
);
}
}
if
(
!
opt_xml
)
if
(
!
opt_xml
)
fputs
(
"
\n
\n
"
,
md_result_file
);
fputs
(
"
\n
"
,
md_result_file
);
if
(
mysql_query
(
sock
,
query
))
if
(
mysql_query
(
sock
,
query
))
{
{
DBerror
(
sock
,
"when retrieving data from server"
);
DBerror
(
sock
,
"when retrieving data from server"
);
...
@@ -998,6 +992,9 @@ static void dumpTable(uint numFields, char *table)
...
@@ -998,6 +992,9 @@ static void dumpTable(uint numFields, char *table)
return
;
return
;
}
}
if
(
opt_disable_keys
)
fprintf
(
md_result_file
,
"/*!40000 ALTER TABLE %s DISABLE KEYS */;
\n
"
,
quote_name
(
table
,
table_buff
));
if
(
opt_lock
)
if
(
opt_lock
)
fprintf
(
md_result_file
,
"LOCK TABLES %s WRITE;
\n
"
,
fprintf
(
md_result_file
,
"LOCK TABLES %s WRITE;
\n
"
,
quote_name
(
table
,
table_buff
));
quote_name
(
table
,
table_buff
));
...
@@ -1021,6 +1018,9 @@ static void dumpTable(uint numFields, char *table)
...
@@ -1021,6 +1018,9 @@ static void dumpTable(uint numFields, char *table)
fputs
(
insert_pat
,
md_result_file
);
fputs
(
insert_pat
,
md_result_file
);
mysql_field_seek
(
res
,
0
);
mysql_field_seek
(
res
,
0
);
if
(
opt_xml
)
fprintf
(
md_result_file
,
"
\t
<row>
\n
"
);
for
(
i
=
0
;
i
<
mysql_num_fields
(
res
);
i
++
)
for
(
i
=
0
;
i
<
mysql_num_fields
(
res
);
i
++
)
{
{
if
(
!
(
field
=
mysql_fetch_field
(
res
)))
if
(
!
(
field
=
mysql_fetch_field
(
res
)))
...
@@ -1110,6 +1110,9 @@ static void dumpTable(uint numFields, char *table)
...
@@ -1110,6 +1110,9 @@ static void dumpTable(uint numFields, char *table)
}
}
}
}
if
(
opt_xml
)
fprintf
(
md_result_file
,
"
\t
</row>
\n
"
);
if
(
extended_insert
)
if
(
extended_insert
)
{
{
ulong
row_length
;
ulong
row_length
;
...
@@ -1157,11 +1160,11 @@ static void dumpTable(uint numFields, char *table)
...
@@ -1157,11 +1160,11 @@ static void dumpTable(uint numFields, char *table)
safe_exit
(
EX_CONSCHECK
);
safe_exit
(
EX_CONSCHECK
);
return
;
return
;
}
}
if
(
opt_disable_keys
)
fprintf
(
md_result_file
,
"
\n
/*!40000 ALTER TABLE %s ENABLE KEYS */;
\n
"
,
quote_name
(
table
,
table_buff
));
if
(
opt_lock
)
if
(
opt_lock
)
fputs
(
"UNLOCK TABLES;
\n
"
,
md_result_file
);
fputs
(
"UNLOCK TABLES;
\n
"
,
md_result_file
);
if
(
opt_disable_keys
)
fprintf
(
md_result_file
,
"/*!40000 ALTER TABLE %s ENABLE KEYS */;
\n
"
,
quote_name
(
table
,
table_buff
));
if
(
opt_autocommit
)
if
(
opt_autocommit
)
fprintf
(
md_result_file
,
"commit;
\n
"
);
fprintf
(
md_result_file
,
"commit;
\n
"
);
mysql_free_result
(
res
);
mysql_free_result
(
res
);
...
@@ -1187,7 +1190,7 @@ static void print_quoted_xml(FILE *output, char *fname, char *str, uint len)
...
@@ -1187,7 +1190,7 @@ static void print_quoted_xml(FILE *output, char *fname, char *str, uint len)
else
else
fputc
(
*
str
,
output
);
fputc
(
*
str
,
output
);
}
}
fprintf
(
output
,
"<%s>
\n
"
,
fname
);
fprintf
(
output
,
"<
/
%s>
\n
"
,
fname
);
}
}
static
char
*
getTableName
(
int
reset
)
static
char
*
getTableName
(
int
reset
)
...
...
client/mysqlimport.c
View file @
c9d04284
...
@@ -47,6 +47,7 @@ static char *opt_password=0, *current_user=0,
...
@@ -47,6 +47,7 @@ static char *opt_password=0, *current_user=0,
*
escaped
=
0
,
*
opt_columns
=
0
,
*
default_charset
;
*
escaped
=
0
,
*
opt_columns
=
0
,
*
default_charset
;
static
uint
opt_mysql_port
=
0
;
static
uint
opt_mysql_port
=
0
;
static
my_string
opt_mysql_unix_port
=
0
;
static
my_string
opt_mysql_unix_port
=
0
;
static
my_string
opt_ignore_lines
=
0
;
#include "sslopt-vars.h"
#include "sslopt-vars.h"
static
struct
my_option
my_long_options
[]
=
static
struct
my_option
my_long_options
[]
=
...
@@ -89,6 +90,8 @@ static struct my_option my_long_options[] =
...
@@ -89,6 +90,8 @@ static struct my_option my_long_options[] =
(
gptr
*
)
&
current_host
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_host
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"ignore"
,
'i'
,
"If duplicate unique key was found, keep old row."
,
{
"ignore"
,
'i'
,
"If duplicate unique key was found, keep old row."
,
(
gptr
*
)
&
ignore
,
(
gptr
*
)
&
ignore
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
ignore
,
(
gptr
*
)
&
ignore
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"ignore-lines"
,
OPT_IGN_LINES
,
"Ignore first n lines of data infile."
,
0
,
0
,
0
,
GET_LL
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"lines-terminated-by"
,
OPT_LTB
,
"Lines in the i.file are terminated by ..."
,
{
"lines-terminated-by"
,
OPT_LTB
,
"Lines in the i.file are terminated by ..."
,
(
gptr
*
)
&
lines_terminated
,
(
gptr
*
)
&
lines_terminated
,
0
,
GET_STR
,
(
gptr
*
)
&
lines_terminated
,
(
gptr
*
)
&
lines_terminated
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
@@ -227,6 +230,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -227,6 +230,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case
(
int
)
OPT_ESC
:
case
(
int
)
OPT_ESC
:
escaped
=
argument
;
escaped
=
argument
;
break
;
break
;
case
(
int
)
OPT_IGN_LINES
:
opt_ignore_lines
=
argument
;
break
;
#include "sslopt-case.h"
#include "sslopt-case.h"
}
}
return
0
;
return
0
;
...
@@ -327,6 +333,8 @@ static int write_to_table(char *filename, MYSQL *sock)
...
@@ -327,6 +333,8 @@ static int write_to_table(char *filename, MYSQL *sock)
" OPTIONALLY ENCLOSED BY"
);
" OPTIONALLY ENCLOSED BY"
);
end
=
add_load_option
(
end
,
escaped
,
" ESCAPED BY"
);
end
=
add_load_option
(
end
,
escaped
,
" ESCAPED BY"
);
end
=
add_load_option
(
end
,
lines_terminated
,
" LINES TERMINATED BY"
);
end
=
add_load_option
(
end
,
lines_terminated
,
" LINES TERMINATED BY"
);
if
(
opt_ignore_lines
)
end
=
strmov
(
strmov
(
strmov
(
end
,
" IGNORE "
),
opt_ignore_lines
),
" LINES"
);
if
(
opt_columns
)
if
(
opt_columns
)
end
=
strmov
(
strmov
(
strmov
(
end
,
" ("
),
opt_columns
),
")"
);
end
=
strmov
(
strmov
(
strmov
(
end
,
" ("
),
opt_columns
),
")"
);
*
end
=
'\0'
;
*
end
=
'\0'
;
...
@@ -379,6 +387,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
...
@@ -379,6 +387,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_init
(
&
mysql_connection
);
mysql_init
(
&
mysql_connection
);
if
(
opt_compress
)
if
(
opt_compress
)
mysql_options
(
&
mysql_connection
,
MYSQL_OPT_COMPRESS
,
NullS
);
mysql_options
(
&
mysql_connection
,
MYSQL_OPT_COMPRESS
,
NullS
);
if
(
opt_local_file
)
mysql_options
(
&
mysql_connection
,
MYSQL_OPT_LOCAL_INFILE
,
(
char
*
)
&
opt_local_file
);
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
if
(
opt_use_ssl
)
if
(
opt_use_ssl
)
mysql_ssl_set
(
&
mysql_connection
,
opt_ssl_key
,
opt_ssl_cert
,
opt_ssl_ca
,
mysql_ssl_set
(
&
mysql_connection
,
opt_ssl_key
,
opt_ssl_cert
,
opt_ssl_ca
,
...
...
myisam/myisamchk.c
View file @
c9d04284
...
@@ -196,9 +196,10 @@ static struct my_option my_long_options[] =
...
@@ -196,9 +196,10 @@ static struct my_option my_long_options[] =
{
"keys-used"
,
'k'
,
{
"keys-used"
,
'k'
,
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!"
,
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!"
,
(
gptr
*
)
&
check_param
.
keys_in_use
,
(
gptr
*
)
&
check_param
.
keys_in_use
,
0
,
(
gptr
*
)
&
check_param
.
keys_in_use
,
(
gptr
*
)
&
check_param
.
keys_in_use
,
0
,
GET_L
ONG
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
GET_L
L
,
REQUIRED_ARG
,
-
1
,
0
,
0
,
0
,
0
,
0
},
{
"medium-check"
,
'm'
,
{
"medium-check"
,
'm'
,
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
},
0
},
{
"quick"
,
'q'
,
"Faster repair by not modifying the data file."
,
0
,
0
,
0
,
{
"quick"
,
'q'
,
"Faster repair by not modifying the data file."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
@@ -392,8 +393,6 @@ get_one_option(int optid,
...
@@ -392,8 +393,6 @@ get_one_option(int optid,
const
struct
my_option
*
opt
__attribute__
((
unused
)),
const
struct
my_option
*
opt
__attribute__
((
unused
)),
char
*
argument
)
char
*
argument
)
{
{
uint
old_testflag
;
switch
(
optid
)
{
switch
(
optid
)
{
case
'a'
:
case
'a'
:
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
...
@@ -425,10 +424,7 @@ get_one_option(int optid,
...
@@ -425,10 +424,7 @@ get_one_option(int optid,
break
;
break
;
case
'C'
:
case
'C'
:
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
testflag
&=
~
(
T_CHECK
|
T_CHECK_ONLY_CHANGED
);
check_param
.
testflag
&=
~
T_CHECK
;
check_param
.
testflag
&=
~
T_CHECK_ONLY_CHANGED
;
}
else
else
check_param
.
testflag
|=
T_CHECK
|
T_CHECK_ONLY_CHANGED
;
check_param
.
testflag
|=
T_CHECK
|
T_CHECK_ONLY_CHANGED
;
break
;
break
;
...
@@ -437,11 +433,7 @@ get_one_option(int optid,
...
@@ -437,11 +433,7 @@ get_one_option(int optid,
break
;
break
;
case
's'
:
/* silent */
case
's'
:
/* silent */
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
testflag
&=
~
(
T_SILENT
|
T_VERY_SILENT
);
if
(
check_param
.
testflag
&
T_VERY_SILENT
)
check_param
.
testflag
&=
~
T_VERY_SILENT
;
check_param
.
testflag
&=
~
T_SILENT
;
}
else
else
{
{
if
(
check_param
.
testflag
&
T_SILENT
)
if
(
check_param
.
testflag
&
T_SILENT
)
...
@@ -475,8 +467,16 @@ get_one_option(int optid,
...
@@ -475,8 +467,16 @@ get_one_option(int optid,
check_param
.
testflag
|=
T_INFO
;
check_param
.
testflag
|=
T_INFO
;
break
;
break
;
case
'f'
:
case
'f'
:
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
|
O_EXCL
;
check_param
.
testflag
&=
~
(
T_FORCE_CREATE
|
T_UPDATE_STATE
);
}
else
{
check_param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
check_param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
check_param
.
testflag
|=
T_FORCE_CREATE
|
T_UPDATE_STATE
;
check_param
.
testflag
|=
T_FORCE_CREATE
|
T_UPDATE_STATE
;
}
break
;
break
;
case
'F'
:
case
'F'
:
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
...
@@ -494,41 +494,66 @@ get_one_option(int optid,
...
@@ -494,41 +494,66 @@ get_one_option(int optid,
check_param
.
testflag
|=
T_MEDIUM
;
/* Medium check */
check_param
.
testflag
|=
T_MEDIUM
;
/* Medium check */
break
;
break
;
case
'r'
:
/* Repair table */
case
'r'
:
/* Repair table */
if
(
argument
&&
*
argument
==
'0'
)
check_param
.
testflag
&=
~
(
T_REP
|
T_REP_BY_SORT
);
else
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP
)
|
T_REP_BY_SORT
;
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP
)
|
T_REP_BY_SORT
;
break
;
break
;
case
'o'
:
case
'o'
:
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
testflag
&=
~
(
T_REP
|
T_REP_BY_SORT
);
check_param
.
force_sort
=
0
;
}
else
{
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP_BY_SORT
)
|
T_REP
;
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP_BY_SORT
)
|
T_REP
;
check_param
.
force_sort
=
0
;
check_param
.
force_sort
=
0
;
my_disable_async_io
=
1
;
/* More safety */
my_disable_async_io
=
1
;
/* More safety */
}
break
;
break
;
case
'n'
:
case
'n'
:
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
testflag
&=
~
(
T_REP
|
T_REP_BY_SORT
);
check_param
.
force_sort
=
0
;
}
else
{
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP
)
|
T_REP_BY_SORT
;
check_param
.
testflag
=
(
check_param
.
testflag
&
~
T_REP
)
|
T_REP_BY_SORT
;
check_param
.
force_sort
=
1
;
check_param
.
force_sort
=
1
;
}
break
;
break
;
case
'q'
:
case
'q'
:
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
check_param
.
opt_rep_quick
--
;
check_param
.
testflag
&=
~
(
T_QUICK
|
T_FORCE_UNIQUENESS
);
else
else
check_param
.
opt_rep_quick
++
;
check_param
.
testflag
|=
(
check_param
.
testflag
&
T_QUICK
)
?
T_FORCE_UNIQUENESS
:
T_QUICK
;
break
;
break
;
case
'u'
:
case
'u'
:
if
(
argument
==
disabled_my_option
)
if
(
argument
==
disabled_my_option
)
{
check_param
.
testflag
&=
~
(
T_UNPACK
|
T_REP_BY_SORT
);
check_param
.
testflag
&=
~
T_UNPACK
;
check_param
.
testflag
&=
~
T_REP_BY_SORT
;
}
else
else
check_param
.
testflag
|=
T_UNPACK
|
T_REP_BY_SORT
;
check_param
.
testflag
|=
T_UNPACK
|
T_REP_BY_SORT
;
break
;
break
;
case
'v'
:
/* Verbose */
case
'v'
:
/* Verbose */
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
{
check_param
.
testflag
&=
~
T_VERBOSE
;
check_param
.
testflag
&=
~
T_VERBOSE
;
check_param
.
verbose
=
0
;
}
else
else
{
check_param
.
testflag
|=
T_VERBOSE
;
check_param
.
testflag
|=
T_VERBOSE
;
check_param
.
verbose
++
;
check_param
.
verbose
++
;
}
break
;
break
;
case
'R'
:
/* Sort records */
case
'R'
:
/* Sort records */
old_testflag
=
check_param
.
testflag
;
if
(
argument
&&
*
argument
==
'0'
)
check_param
.
testflag
&=
~
T_SORT_RECORDS
;
else
{
check_param
.
testflag
|=
T_SORT_RECORDS
;
check_param
.
testflag
|=
T_SORT_RECORDS
;
check_param
.
opt_sort_key
=
(
uint
)
atoi
(
argument
)
-
1
;
check_param
.
opt_sort_key
=
(
uint
)
atoi
(
argument
)
-
1
;
if
(
check_param
.
opt_sort_key
>=
MI_MAX_KEY
)
if
(
check_param
.
opt_sort_key
>=
MI_MAX_KEY
)
...
@@ -538,17 +563,14 @@ get_one_option(int optid,
...
@@ -538,17 +563,14 @@ get_one_option(int optid,
MI_MAX_KEY
);
MI_MAX_KEY
);
exit
(
1
);
exit
(
1
);
}
}
}
break
;
break
;
case
'S'
:
/* Sort index */
case
'S'
:
/* Sort index */
old_testflag
=
check_param
.
testflag
;
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
check_param
.
testflag
&=
~
T_SORT_INDEX
;
check_param
.
testflag
&=
~
T_SORT_INDEX
;
else
else
check_param
.
testflag
|=
T_SORT_INDEX
;
check_param
.
testflag
|=
T_SORT_INDEX
;
break
;
break
;
case
't'
:
check_param
.
tmpdir
=
argument
;
break
;
case
'T'
:
case
'T'
:
if
(
argument
&&
*
argument
==
'0'
)
if
(
argument
&&
*
argument
==
'0'
)
check_param
.
testflag
&=
~
T_READONLY
;
check_param
.
testflag
&=
~
T_READONLY
;
...
@@ -562,7 +584,14 @@ get_one_option(int optid,
...
@@ -562,7 +584,14 @@ get_one_option(int optid,
check_param
.
testflag
|=
T_UPDATE_STATE
;
check_param
.
testflag
|=
T_UPDATE_STATE
;
break
;
break
;
case
'#'
:
case
'#'
:
if
(
argument
&&
*
argument
==
'0'
)
{
DBUG_POP
();
}
else
{
DBUG_PUSH
(
argument
?
argument
:
"d:t:o,/tmp/myisamchk.trace"
);
DBUG_PUSH
(
argument
?
argument
:
"d:t:o,/tmp/myisamchk.trace"
);
}
break
;
break
;
case
'V'
:
case
'V'
:
print_version
();
print_version
();
...
@@ -608,7 +637,7 @@ static void get_options(register int *argc,register char ***argv)
...
@@ -608,7 +637,7 @@ static void get_options(register int *argc,register char ***argv)
}
}
if
((
check_param
.
testflag
&
T_UNPACK
)
&&
if
((
check_param
.
testflag
&
T_UNPACK
)
&&
(
check_param
.
opt_rep_quick
||
(
check_param
.
testflag
&
T_SORT_RECORDS
)))
(
check_param
.
testflag
&
(
T_QUICK
|
T_SORT_RECORDS
)))
{
{
VOID
(
fprintf
(
stderr
,
VOID
(
fprintf
(
stderr
,
"%s: --unpack can't be used with --quick or --sort-records
\n
"
,
"%s: --unpack can't be used with --quick or --sort-records
\n
"
,
...
@@ -640,7 +669,7 @@ static void get_options(register int *argc,register char ***argv)
...
@@ -640,7 +669,7 @@ static void get_options(register int *argc,register char ***argv)
static
int
myisamchk
(
MI_CHECK
*
param
,
my_string
filename
)
static
int
myisamchk
(
MI_CHECK
*
param
,
my_string
filename
)
{
{
int
error
,
lock_type
,
recreate
;
int
error
,
lock_type
,
recreate
;
int
rep_quick
=
param
->
opt_rep_quick
;
int
rep_quick
=
param
->
testflag
&
(
T_QUICK
|
T_FORCE_UNIQUENESS
)
;
uint
raid_chunks
;
uint
raid_chunks
;
MI_INFO
*
info
;
MI_INFO
*
info
;
File
datafile
;
File
datafile
;
...
@@ -775,8 +804,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
...
@@ -775,8 +804,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
param
->
testflag
|=
T_REP_BY_SORT
;
/* if only STATISTICS */
param
->
testflag
|=
T_REP_BY_SORT
;
/* if only STATISTICS */
if
(
!
(
param
->
testflag
&
T_SILENT
))
if
(
!
(
param
->
testflag
&
T_SILENT
))
printf
(
"- '%s' has old table-format. Recreating index
\n
"
,
filename
);
printf
(
"- '%s' has old table-format. Recreating index
\n
"
,
filename
);
if
(
!
rep_quick
)
rep_quick
|=
T_QUICK
;
rep_quick
=
1
;
}
}
share
=
info
->
s
;
share
=
info
->
s
;
share
->
r_locks
=
0
;
share
->
r_locks
=
0
;
...
...
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