summaryrefslogtreecommitdiff
path: root/sql/examples
diff options
context:
space:
mode:
Diffstat (limited to 'sql/examples')
-rw-r--r--sql/examples/ha_archive.cc11
-rw-r--r--sql/examples/ha_archive.h1
-rw-r--r--sql/examples/ha_example.cc2
-rw-r--r--sql/examples/ha_tina.cc2
4 files changed, 15 insertions, 1 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index 1756bae02a1..7b9f6e23548 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -1028,4 +1028,15 @@ int ha_archive::end_bulk_insert()
share->dirty= TRUE;
DBUG_RETURN(0);
}
+
+/*
+ We cancel a truncate command. The only way to delete an archive table is to drop it.
+ This is done for security reasons. In a later version we will enable this by
+ allowing the user to select a different row format.
+*/
+int ha_archive::delete_all_rows()
+{
+ DBUG_ENTER("ha_archive::delete_all_rows");
+ DBUG_RETURN(0);
+}
#endif /* HAVE_ARCHIVE_DB */
diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h
index 41835c5fb6f..e2d8aa49add 100644
--- a/sql/examples/ha_archive.h
+++ b/sql/examples/ha_archive.h
@@ -78,6 +78,7 @@ public:
int close(void);
int write_row(byte * buf);
int real_write_row(byte *buf, gzFile writer);
+ int delete_all_rows();
int rnd_init(bool scan=1);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc
index a7e193b9730..dfc2fa7a260 100644
--- a/sql/examples/ha_example.cc
+++ b/sql/examples/ha_example.cc
@@ -67,7 +67,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <mysql_priv.h>
+#include "../mysql_priv.h"
#ifdef HAVE_EXAMPLE_DB
#include "ha_example.h"
diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc
index 1e2751f3016..74ff3457cd2 100644
--- a/sql/examples/ha_tina.cc
+++ b/sql/examples/ha_tina.cc
@@ -650,7 +650,9 @@ int ha_tina::rnd_init(bool scan)
current_position= next_position= 0;
records= 0;
chain_ptr= chain;
+#ifdef HAVE_MADVISE
(void)madvise(share->mapped_file,share->file_stat.st_size,MADV_SEQUENTIAL);
+#endif
DBUG_RETURN(0);
}