Skip to content

Commit 3d7e06d

Browse files
committed
cleanup: remove dead code
1 parent ffb83ba commit 3d7e06d

File tree

3 files changed

+1
-103
lines changed

3 files changed

+1
-103
lines changed

sql/ha_partition.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,17 +1443,6 @@ class ha_partition :public handler
14431443
void append_row_to_str(String &str);
14441444
public:
14451445

1446-
/*
1447-
-------------------------------------------------------------------------
1448-
Admin commands not supported currently (almost purely MyISAM routines)
1449-
This means that the following methods are not implemented:
1450-
-------------------------------------------------------------------------
1451-
1452-
virtual int backup(TD* thd, HA_CHECK_OPT *check_opt);
1453-
virtual int restore(THD* thd, HA_CHECK_OPT *check_opt);
1454-
virtual int dump(THD* thd, int fd = -1);
1455-
virtual int net_read_dump(NET* net);
1456-
*/
14571446
/* Enabled keycache for performance reasons, WL#4571 */
14581447
virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt);
14591448
virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);

storage/maria/ha_maria.cc

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,92 +1081,7 @@ uint ha_maria::max_supported_key_length() const
10811081
return maria_max_key_length();
10821082
}
10831083

1084-
1085-
#ifdef HAVE_REPLICATION
1086-
int ha_maria::net_read_dump(NET * net)
1087-
{
1088-
int data_fd= file->dfile.file;
1089-
int error= 0;
1090-
1091-
mysql_file_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME));
1092-
for (;;)
1093-
{
1094-
ulong packet_len= my_net_read(net);
1095-
if (!packet_len)
1096-
break; // end of file
1097-
if (packet_len == packet_error)
1098-
{
1099-
sql_print_error("ha_maria::net_read_dump - read error ");
1100-
error= -1;
1101-
goto err;
1102-
}
1103-
if (mysql_file_write(data_fd, (uchar *) net->read_pos, (uint) packet_len,
1104-
MYF(MY_WME | MY_FNABP)))
1105-
{
1106-
error= errno;
1107-
goto err;
1108-
}
1109-
}
1110-
err:
1111-
return error;
1112-
}
1113-
1114-
1115-
int ha_maria::dump(THD * thd, int fd)
1116-
{
1117-
MARIA_SHARE *share= file->s;
1118-
NET *net= &thd->net;
1119-
uint block_size= share->block_size;
1120-
my_off_t bytes_to_read= share->state.state.data_file_length;
1121-
int data_fd= file->dfile.file;
1122-
uchar *buf= (uchar *) my_malloc(block_size, MYF(MY_WME));
1123-
if (!buf)
1124-
return ENOMEM;
1125-
1126-
int error= 0;
1127-
mysql_file_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME));
1128-
for (; bytes_to_read > 0;)
1129-
{
1130-
size_t bytes= mysql_file_read(data_fd, buf, block_size, MYF(MY_WME));
1131-
if (bytes == MY_FILE_ERROR)
1132-
{
1133-
error= errno;
1134-
goto err;
1135-
}
1136-
1137-
if (fd >= 0)
1138-
{
1139-
if (mysql_file_write(fd, buf, bytes, MYF(MY_WME | MY_FNABP)))
1140-
{
1141-
error= errno ? errno : EPIPE;
1142-
goto err;
1143-
}
1144-
}
1145-
else
1146-
{
1147-
if (my_net_write(net, buf, bytes))
1148-
{
1149-
error= errno ? errno : EPIPE;
1150-
goto err;
1151-
}
1152-
}
1153-
bytes_to_read -= bytes;
1154-
}
1155-
1156-
if (fd < 0)
1157-
{
1158-
if (my_net_write(net, (uchar*) "", 0))
1159-
error= errno ? errno : EPIPE;
1160-
net_flush(net);
1161-
}
1162-
1163-
err:
1164-
my_free(buf);
1165-
return error;
1166-
}
1167-
#endif /* HAVE_REPLICATION */
1168-
1169-
/* Name is here without an extension */
1084+
/* Name is here without an extension */
11701085

11711086
int ha_maria::open(const char *name, int mode, uint test_if_locked)
11721087
{

storage/maria/ha_maria.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,9 @@ class ha_maria :public handler
151151

152152
}
153153
int optimize(THD * thd, HA_CHECK_OPT * check_opt);
154-
int restore(THD * thd, HA_CHECK_OPT * check_opt);
155-
int backup(THD * thd, HA_CHECK_OPT * check_opt);
156154
int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt);
157155
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt);
158156
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
159-
#ifdef HAVE_REPLICATION
160-
int dump(THD * thd, int fd);
161-
int net_read_dump(NET * net);
162-
#endif
163157
#ifdef HAVE_QUERY_CACHE
164158
my_bool register_query_cache_table(THD *thd, const char *table_key,
165159
uint key_length,

0 commit comments

Comments
 (0)