summaryrefslogtreecommitdiff
path: root/innobase/dyn
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2001-02-17 14:19:19 +0200
committerunknown <monty@donna.mysql.com>2001-02-17 14:19:19 +0200
commit2662b59306ef0cd495fa6e2edf7129e58a11393a (patch)
treebfe39951a73e906579ab819bf5198ad8f3a64a36 /innobase/dyn
parent66de55a56bdcf2f7a9c0c4f8e19b3e761475e202 (diff)
downloadmariadb-git-2662b59306ef0cd495fa6e2edf7129e58a11393a.tar.gz
Added Innobase to source distribution
Docs/manual.texi: Added Innobase documentation configure.in: Incremented version include/my_base.h: Added option for Innobase myisam/mi_check.c: cleanup mysql-test/t/bdb.test: cleanup mysql-test/t/innobase.test: Extended with new tests from bdb.test mysql-test/t/merge.test: Added test of SHOW create mysys/my_init.c: Fix for UNIXWARE 7 scripts/mysql_install_db.sh: Always write how to start mysqld scripts/safe_mysqld.sh: Fixed type sql/ha_innobase.cc: Update to new version sql/ha_innobase.h: Update to new version sql/handler.h: Added 'update_table_comment()' and 'append_create_info()' sql/sql_delete.cc: Fixes for Innobase sql/sql_select.cc: Fixes for Innobase sql/sql_show.cc: Append create information (for MERGE tables) sql/sql_update.cc: Fixes for Innobase
Diffstat (limited to 'innobase/dyn')
-rw-r--r--innobase/dyn/Makefile.am24
-rw-r--r--innobase/dyn/dyn0dyn.c48
-rw-r--r--innobase/dyn/makefilewin9
-rw-r--r--innobase/dyn/ts/makefile12
-rw-r--r--innobase/dyn/ts/tsdyn.c57
5 files changed, 150 insertions, 0 deletions
diff --git a/innobase/dyn/Makefile.am b/innobase/dyn/Makefile.am
new file mode 100644
index 00000000000..79c0000868c
--- /dev/null
+++ b/innobase/dyn/Makefile.am
@@ -0,0 +1,24 @@
+# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+# & Innobase Oy
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+include ../include/Makefile.i
+
+libs_LIBRARIES = libdyn.a
+
+libdyn_a_SOURCES = dyn0dyn.c
+
+EXTRA_PROGRAMS =
diff --git a/innobase/dyn/dyn0dyn.c b/innobase/dyn/dyn0dyn.c
new file mode 100644
index 00000000000..0afe6eda856
--- /dev/null
+++ b/innobase/dyn/dyn0dyn.c
@@ -0,0 +1,48 @@
+/******************************************************
+The dynamically allocated array
+
+(c) 1996 Innobase Oy
+
+Created 2/5/1996 Heikki Tuuri
+*******************************************************/
+
+#include "dyn0dyn.h"
+#ifdef UNIV_NONINL
+#include "dyn0dyn.ic"
+#endif
+
+/****************************************************************
+Adds a new block to a dyn array. */
+
+dyn_block_t*
+dyn_array_add_block(
+/*================*/
+ /* out: created block */
+ dyn_array_t* arr) /* in: dyn array */
+{
+ mem_heap_t* heap;
+ dyn_block_t* block;
+
+ ut_ad(arr);
+ ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
+
+ if (arr->heap == NULL) {
+ UT_LIST_INIT(arr->base);
+ UT_LIST_ADD_FIRST(list, arr->base, arr);
+
+ arr->heap = mem_heap_create(sizeof(dyn_block_t));
+ }
+
+ block = dyn_array_get_last_block(arr);
+ block->used = block->used | DYN_BLOCK_FULL_FLAG;
+
+ heap = arr->heap;
+
+ block = mem_heap_alloc(heap, sizeof(dyn_block_t));
+
+ block->used = 0;
+
+ UT_LIST_ADD_LAST(list, arr->base, block);
+
+ return(block);
+}
diff --git a/innobase/dyn/makefilewin b/innobase/dyn/makefilewin
new file mode 100644
index 00000000000..71a58a756c1
--- /dev/null
+++ b/innobase/dyn/makefilewin
@@ -0,0 +1,9 @@
+include ..\include\makefile.i
+
+dyn.lib: dyn0dyn.obj makefile
+ lib -out:..\libs\dyn.lib dyn0dyn.obj
+
+dyn0dyn.obj: dyn0dyn.c
+ $(CCOM) $(CFL) -c dyn0dyn.c
+
+
diff --git a/innobase/dyn/ts/makefile b/innobase/dyn/ts/makefile
new file mode 100644
index 00000000000..b4b5ad5eadf
--- /dev/null
+++ b/innobase/dyn/ts/makefile
@@ -0,0 +1,12 @@
+
+include ..\..\makefile.i
+
+tsdyn: ..\dyn.lib tsdyn.c makefile
+ $(CCOM) $(CFL) -I.. -I..\.. ..\dyn.lib ..\..\mem.lib ..\..\ut.lib ..\..\mach.lib ..\..\sync.lib ..\..\os.lib tsdyn.c $(LFL)
+
+
+
+
+
+
+
diff --git a/innobase/dyn/ts/tsdyn.c b/innobase/dyn/ts/tsdyn.c
new file mode 100644
index 00000000000..4c21583d9d8
--- /dev/null
+++ b/innobase/dyn/ts/tsdyn.c
@@ -0,0 +1,57 @@
+/************************************************************************
+The test module for dynamic array
+
+(c) 1996 Innobase Oy
+
+Created 2/5/1996 Heikki Tuuri
+*************************************************************************/
+
+#include "../dyn0dyn.h"
+#include "sync0sync.h"
+#include "mem0mem.h"
+
+/****************************************************************
+Basic test. */
+
+void
+test1(void)
+/*=======*/
+{
+ dyn_array_t dyn;
+ ulint i;
+ ulint* ulint_ptr;
+
+ printf("-------------------------------------------\n");
+ printf("TEST 1. Basic test\n");
+
+ dyn_array_create(&dyn);
+
+ for (i = 0; i < 1000; i++) {
+ ulint_ptr = dyn_array_push(&dyn, sizeof(ulint));
+ *ulint_ptr = i;
+ }
+
+ ut_a(dyn_array_get_n_elements(&dyn) == 1000);
+
+ for (i = 0; i < 1000; i++) {
+ ulint_ptr = dyn_array_get_nth_element(&dyn, i, sizeof(ulint));
+ ut_a(*ulint_ptr == i);
+ }
+
+ dyn_array_free(&dyn);
+}
+
+void
+main(void)
+{
+ sync_init();
+ mem_init();
+
+ test1();
+
+ ut_ad(sync_all_freed());
+
+ ut_ad(mem_all_freed());
+
+ printf("TEST SUCCESSFULLY COMPLETED!\n");
+}