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
31fa2c50
Commit
31fa2c50
authored
Nov 13, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
a69c61a0
5563f67c
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
293 additions
and
22 deletions
+293
-22
BitKeeper/etc/gone
BitKeeper/etc/gone
+38
-0
client/mysqlcheck.c
client/mysqlcheck.c
+23
-10
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+222
-10
sql/ha_myisam.cc
sql/ha_myisam.cc
+10
-2
No files found.
BitKeeper/etc/gone
View file @
31fa2c50
This diff is collapsed.
Click to expand it.
client/mysqlcheck.c
View file @
31fa2c50
...
...
@@ -352,21 +352,25 @@ static int process_selected_tables(char *db, char **table_names, int tables)
return
1
;
if
(
opt_all_in_1
)
{
/*
We need table list in form `a`, `b`, `c`
that's why we need 4 more chars added to to each table name
space is for more readable output in logs and in case of error
*/
char
*
table_names_comma_sep
,
*
end
;
int
i
,
tot_length
=
0
;
for
(
i
=
0
;
i
<
tables
;
i
++
)
tot_length
+=
strlen
(
*
(
table_names
+
i
))
+
1
;
tot_length
+=
strlen
(
*
(
table_names
+
i
))
+
4
;
if
(
!
(
table_names_comma_sep
=
(
char
*
)
my_malloc
((
sizeof
(
char
)
*
tot_length
)
+
1
,
MYF
(
MY_WME
))))
my_malloc
((
sizeof
(
char
)
*
tot_length
)
+
4
,
MYF
(
MY_WME
))))
return
1
;
for
(
end
=
table_names_comma_sep
+
1
;
tables
>
0
;
tables
--
,
table_names
++
)
{
end
=
strmov
(
end
,
*
table_names
);
*
end
++=
','
;
end
=
strxmov
(
end
,
" `"
,
*
table_names
,
"`,"
,
NullS
);
}
*--
end
=
0
;
handle_request_for_tables
(
table_names_comma_sep
+
1
,
tot_length
-
1
);
...
...
@@ -393,22 +397,27 @@ static int process_all_tables_in_db(char *database)
if
(
opt_all_in_1
)
{
/*
We need table list in form `a`, `b`, `c`
that's why we need 4 more chars added to to each table name
space is for more readable output in logs and in case of error
*/
char
*
tables
,
*
end
;
uint
tot_length
=
0
;
while
((
row
=
mysql_fetch_row
(
res
)))
tot_length
+=
strlen
(
row
[
0
])
+
1
;
tot_length
+=
strlen
(
row
[
0
])
+
4
;
mysql_data_seek
(
res
,
0
);
if
(
!
(
tables
=
(
char
*
)
my_malloc
(
sizeof
(
char
)
*
tot_length
+
1
,
MYF
(
MY_WME
))))
if
(
!
(
tables
=
(
char
*
)
my_malloc
(
sizeof
(
char
)
*
tot_length
+
4
,
MYF
(
MY_WME
))))
{
mysql_free_result
(
res
);
return
1
;
}
for
(
end
=
tables
+
1
;
(
row
=
mysql_fetch_row
(
res
))
;)
{
end
=
strmov
(
end
,
row
[
0
]);
*
end
++=
','
;
end
=
strxmov
(
end
,
" `"
,
row
[
0
],
"`,"
,
NullS
);
}
*--
end
=
0
;
if
(
tot_length
)
...
...
@@ -468,10 +477,14 @@ static int handle_request_for_tables(char *tables, uint length)
if
(
!
(
query
=
(
char
*
)
my_malloc
((
sizeof
(
char
)
*
(
length
+
110
)),
MYF
(
MY_WME
))))
return
1
;
if
(
opt_all_in_1
)
/* No backticks here as we added them before */
sprintf
(
query
,
"%s TABLE %s %s"
,
op
,
tables
,
options
);
else
sprintf
(
query
,
"%s TABLE `%s` %s"
,
op
,
tables
,
options
);
if
(
mysql_query
(
sock
,
query
))
{
sprintf
(
message
,
"when executing '%s TABLE
`%s` %s"
,
op
,
tables
,
options
);
sprintf
(
message
,
"when executing '%s TABLE
... %s'"
,
op
,
options
);
DBerror
(
sock
,
message
);
return
1
;
}
...
...
mysql-test/t/myisam.test
View file @
31fa2c50
This diff is collapsed.
Click to expand it.
sql/ha_myisam.cc
View file @
31fa2c50
...
...
@@ -566,7 +566,6 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
}
if
(
!
optimize
||
memcmp
(
file
->
state
,
&
share
->
state
.
state
,
sizeof
(
MI_STATUS_INFO
))
||
((
file
->
state
->
del
||
share
->
state
.
split
!=
file
->
state
->
records
)
&&
(
!
(
param
.
testflag
&
T_QUICK
)
||
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
...
...
@@ -625,6 +624,15 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
STATE_CRASHED_ON_REPAIR
);
file
->
update
|=
HA_STATE_CHANGED
|
HA_STATE_ROW_CHANGED
;
}
/* Here we need to make file->save_state and file->s->state.state
equal. Unfortunately, sometime table comes locked here (so
file->save_state represents actual table state), and sometime
unlocked (and actual is file->s->state.state instead). This all
is very confusing, and should be streamlined (TODO).
*/
if
(
file
->
state
==
&
file
->
save_state
)
file
->
s
->
state
.
state
=
file
->
save_state
;
else
file
->
save_state
=
file
->
s
->
state
.
state
;
if
(
file
->
s
->
base
.
auto_key
)
update_auto_increment_key
(
&
param
,
file
,
1
);
...
...
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