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
3ce4d04a
Commit
3ce4d04a
authored
Feb 21, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portability fixes
cleanup
parent
d5ab1624
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
myisam/myisam_ftdump.c
myisam/myisam_ftdump.c
+20
-16
No files found.
myisam/myisam_ftdump.c
View file @
3ce4d04a
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
#include "ftdefs.h"
#include "ftdefs.h"
#include <my_getopt.h>
#include <my_getopt.h>
static
void
get_options
(
int
*
argc
,
char
**
argv
[]);
static
void
usage
();
static
void
usage
();
static
void
complain
(
int
val
);
static
void
complain
(
int
val
);
static
my_bool
get_one_option
(
int
,
const
struct
my_option
*
,
char
*
);
static
int
count
=
0
,
stats
=
0
,
dump
=
0
,
lstats
=
0
;
static
int
count
=
0
,
stats
=
0
,
dump
=
0
,
lstats
=
0
;
static
my_bool
verbose
;
static
my_bool
verbose
;
...
@@ -66,7 +66,8 @@ int main(int argc,char *argv[])
...
@@ -66,7 +66,8 @@ int main(int argc,char *argv[])
struct
{
MI_INFO
*
info
;
}
aio0
,
*
aio
=&
aio0
;
/* for GWS_IN_USE */
struct
{
MI_INFO
*
info
;
}
aio0
,
*
aio
=&
aio0
;
/* for GWS_IN_USE */
MY_INIT
(
argv
[
0
]);
MY_INIT
(
argv
[
0
]);
get_options
(
&
argc
,
&
argv
);
if
(
error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
))
exit
(
error
);
if
(
count
||
dump
)
if
(
count
||
dump
)
verbose
=
0
;
verbose
=
0
;
if
(
!
count
&&
!
dump
&&
!
lstats
&&
!
query
)
if
(
!
count
&&
!
dump
&&
!
lstats
&&
!
query
)
...
@@ -78,10 +79,19 @@ int main(int argc,char *argv[])
...
@@ -78,10 +79,19 @@ int main(int argc,char *argv[])
if
(
argc
<
2
)
if
(
argc
<
2
)
usage
();
usage
();
{
char
*
end
;
inx
=
strtoll
(
argv
[
1
],
&
end
,
10
);
if
(
*
end
)
usage
();
}
if
(
!
(
info
=
mi_open
(
argv
[
0
],
2
,
HA_OPEN_ABORT_IF_LOCKED
)))
if
(
!
(
info
=
mi_open
(
argv
[
0
],
2
,
HA_OPEN_ABORT_IF_LOCKED
)))
{
error
=
my_errno
;
goto
err
;
goto
err
;
}
inx
=
atoi
(
argv
[
1
]);
*
buf2
=
0
;
*
buf2
=
0
;
aio
->
info
=
info
;
aio
->
info
=
info
;
...
@@ -92,6 +102,8 @@ int main(int argc,char *argv[])
...
@@ -92,6 +102,8 @@ int main(int argc,char *argv[])
goto
err
;
goto
err
;
}
}
mi_lock_database
(
info
,
F_EXTRA_LCK
);
if
(
query
)
if
(
query
)
{
{
#if 0
#if 0
...
@@ -108,7 +120,7 @@ int main(int argc,char *argv[])
...
@@ -108,7 +120,7 @@ int main(int argc,char *argv[])
printf("%d rows matched\n",result->ndocs);
printf("%d rows matched\n",result->ndocs);
for(i=0 ; i<result->ndocs ; i++)
for(i=0 ; i<result->ndocs ; i++)
printf("%9
qx %20.7f\n",
result->doc[i].dpos,result->doc[i].weight);
printf("%9
lx %20.7f\n",(ulong)
result->doc[i].dpos,result->doc[i].weight);
ft_nlq_close_search(result);
ft_nlq_close_search(result);
#else
#else
...
@@ -168,11 +180,12 @@ int main(int argc,char *argv[])
...
@@ -168,11 +180,12 @@ int main(int argc,char *argv[])
}
}
}
}
if
(
dump
)
if
(
dump
)
printf
(
"%9
qx %20.7f %s
\n
"
,
info
->
lastpos
,
weight
,
buf
);
printf
(
"%9
lx %20.7f %s
\n
"
,(
ulong
)
info
->
lastpos
,
weight
,
buf
);
if
(
verbose
&&
(
total
%
HOW_OFTEN_TO_WRITE
)
==
0
)
if
(
verbose
&&
(
total
%
HOW_OFTEN_TO_WRITE
)
==
0
)
printf
(
"%10ld
\r
"
,
total
);
printf
(
"%10ld
\r
"
,
total
);
}
}
mi_lock_database
(
info
,
F_UNLCK
);
if
(
stats
)
if
(
stats
)
{
{
...
@@ -183,12 +196,12 @@ int main(int argc,char *argv[])
...
@@ -183,12 +196,12 @@ int main(int argc,char *argv[])
if
((
ulong
)
count
>=
total
/
2
)
if
((
ulong
)
count
>=
total
/
2
)
break
;
break
;
}
}
printf
(
"Total rows: %
q
u
\n
Total words: %lu
\n
"
printf
(
"Total rows: %
l
u
\n
Total words: %lu
\n
"
"Unique words: %lu
\n
Longest word: %lu chars (%s)
\n
"
"Unique words: %lu
\n
Longest word: %lu chars (%s)
\n
"
"Median length: %u
\n
"
"Median length: %u
\n
"
"Average global weight: %f
\n
"
"Average global weight: %f
\n
"
"Most common word: %lu times, weight: %f (%s)
\n
"
,
"Most common word: %lu times, weight: %f (%s)
\n
"
,
(
ulong
long
)
info
->
state
->
records
,
total
,
uniq
,
maxlen
,
buf_maxlen
,
(
ulong
)
info
->
state
->
records
,
total
,
uniq
,
maxlen
,
buf_maxlen
,
inx
,
avg_gws
/
uniq
,
max_doc_cnt
,
min_gws
,
buf_min_gws
);
inx
,
avg_gws
/
uniq
,
max_doc_cnt
,
min_gws
,
buf_min_gws
);
}
}
if
(
lstats
)
if
(
lstats
)
...
@@ -246,15 +259,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -246,15 +259,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
}
static
void
get_options
(
int
*
argc
,
char
**
argv
[])
{
int
ho_error
;
if
((
ho_error
=
handle_options
(
argc
,
argv
,
my_long_options
,
get_one_option
)))
exit
(
ho_error
);
}
/* get options */
static
void
usage
()
static
void
usage
()
{
{
printf
(
"Use: ft_dump <table_name> <index_no>
\n
"
);
printf
(
"Use: ft_dump <table_name> <index_no>
\n
"
);
...
...
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