Commit graph

40 commits

Author SHA1 Message Date
marko
0e4ac2bad8 branches/zip: Free all resources at shutdown. Set pointers to NULL, so
that Valgrind will not complain about freed data structures that are
reachable via pointers.  This addresses Bug #45992 and Bug #46656.

This patch is mostly based on changes copied from branches/embedded-1.0,
mainly c5432, c3439, c3134, c2994, c2978, but also some other code was
copied.  Some added cleanup code is specific to MySQL/InnoDB.

rb://199 approved by Sunny Bains
2009-11-02 09:42:56 +00:00
marko
2d9c90d30d branches/zip: Add some Doxygen comments for many structs, typedefs,
#defines and global variables.  Many are still missing.
2009-05-26 12:28:49 +00:00
marko
118646c603 branches/zip: lexyy.c: Remove the inadvertently added @file directive.
There is nothing for Doxygen to see in this file, move along.
2009-05-25 20:32:35 +00:00
marko
5727d980b6 branches/zip: Add @file comments, and convert decorative
/*********************************
comments to Doxygen /** style like this:
/*****************************//**

This conversion was performed by the following command:

perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) {
s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2}
print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i
2009-05-25 09:52:29 +00:00
marko
5f1c5429d7 branches/zip: Split some long lines that were introduced in r5091. 2009-05-25 08:09:45 +00:00
marko
ae70562abf branches/zip: Adjust some function comments after r5091. 2009-05-25 05:54:17 +00:00
marko
8ab5601eea branches/zip: Convert the function comments to Doxygen format.
This patch was created by running the following commands:

for i in */*[ch]; do doxygenify.pl $i; done
perl -i -pe 's#\*{3} \*/$#****/#' */*[ch]

where doxygenify.pl is
https://svn.innodb.com/svn/misc/trunk/tools/doxygenify.pl r510

Verified the consistency as follows:

(0) not too many /* in: */ or /* out: */ comments left in the code:
grep -l '/\*\s*\(in\|out\)[,:/]' */*[ch]

(1) no difference when ignoring blank lines, after stripping all
C90-style /* comments */, including multi-line ones, before and after
applying this patch:

perl -i -e 'undef $/;while(<ARGV>){s#/\*(.*?)\*/##gs;print}' */*[ch]
diff -I'^\s*$' --exclude .svn -ru TREE1 TREE2

(2) after stripping @return comments and !<, generated a diff and omitted
the hunks where /* out: */ function return comments were removed:

perl -i -e'undef $/;while(<ARGV>){s#!<##g;s#\n\@return\t.*?\*/# \*/#gs;print}'\
 */*[ch]
svn diff|
perl -e 'undef $/;$_=<>;s#\n-\s*/\* out[:,]([^\n]*?)(\n-[^\n]*?)*\*/##gs;print'

Some unintended changes were left.  These will be removed in a
subsequent patch.
2009-05-25 05:30:14 +00:00
marko
13f32345e9 branches/zip: Add missing out: comments to nullary functions. 2009-05-19 06:30:02 +00:00
marko
1a0a9e6a8f branches/zip: Allow in-place updates of UTF-8 CHAR columns
from or to NULL in ROW_FORMAT=REDUNDANT. (Bug #44032)

rb://107 approved by Heikki Tuuri.
2009-04-07 11:45:28 +00:00
vasil
7abbc07d31 branches/zip:
Add the copyright notice to the non C files.
2009-02-17 10:30:55 +00:00
vasil
3fbde20857 branches/zip:
* Remove old Innobase copyright lines from C source files
* Add a reference to the GPLv2 license as recommended by the lawyers
at Oracle Legal

[Step 24/28]
2009-02-17 10:01:41 +00:00
marko
103f5e3e0e branches/zip: Remove update-in-place-in-select from the internal SQL
interpreter.  It was only used for updating the InnoDB internal data
dictionary when renaming or dropping tables.  It could have caused
deadlocks after acquiring latches on insert buffer bitmap pages.
This and r3544 should fix Issue #135.

Furthermore, the update-in-place-in-select does not account for
compression failure.  That was not a problem yet, since the InnoDB SQL
interpreter has so far assumed ROW_FORMAT=REDUNDANT.

rb://63 approved by Heikki Tuuri
2008-12-17 12:40:59 +00:00
marko
c5c5fdc535 branches/zip: make_flex.sh, lexyy.c: Remove some GCC warnings about unused
static symbol definitions.

yy_scan_buffer, yy_scan_string, yy_scan_bytes: Leave these unused extern
function declarations alone.

yypush_buffer_state, yypop_buffer_state, yyswitch_to_buffer, yyget*, yyset*,
yylex_destroy: Add __attribute__((unused)).

This closes Mantis issue #8.
2008-02-07 10:03:54 +00:00
marko
fe5e0b7245 branches/zip: Make the changes to pars0grm.c that were promised in r2276.
pars/pars0grm.h: Remove.  The primary file is include/pars0grm.h.

pars/make_bison.sh: Add from trunk.  Somehow, this file was not merged
at the same time with make_flex.sh.  Add sed magic for replacing the
file name and for hiding yychars, yynerrs, yylval, and yyparse.

pars/pars0grm.c: Apply the changes made by make_bison.sh.
2008-02-06 16:01:57 +00:00
marko
1d1dc31a06 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
891074b0c4 branches/zip: Make static all declarations in the Flex-generated
lexical analyzer of the InnoDB SQL parser.
2008-02-06 13:14:42 +00:00
marko
996edd8a91 branches/zip: Do not access the fields of dfield_t directly.
dfield_dup(): New function for duplicating the data pointed to by dfield_t.

dfield_set_len(), dfield_set_data(): Add Valgrind instrumentation.
2007-10-23 06:46:12 +00:00
marko
095630bfed branches/zip: Relax the string type check of some built-in functions
of the InnoDB SQL parser.

pars_is_string_type(): New function.  Returns TRUE iff mtype equals
DATA_VARCHAR, DATA_CHAR, DATA_FIXBINARY, or DATA_BINARY.

pars_resolve_func_data_type(): Replace checks for DATA_VARCHAR with
pars_is_string_type().  For example, the NAME column of SYS_INDEXES,
SYS_TABLES, and SYS_COLUMNS is of DATA_BINARY type, although it
contains a UTF-8 character string.  This affects the functions
TO_NUMBER, BINARY_TO_NUMBER, LENGTH, INSTR, and SUBSTR.
2007-08-29 09:54:11 +00:00
marko
666c63777c branches/zip: pars_func_get_class(), pars_resolve_func_data_type():
Replace if-else with switch-case.
2007-08-29 09:40:18 +00:00
marko
632ec54002 branches/zip: Make merge sort handle externally stored columns.
Some things still fail in innodb-index.test, and there seems to be
a race condition (data dictionary lock wait) when running with --valgrind.

dfield_t: Add an "external storage" flag, dfield->ext.

dfield_is_null(), dfield_is_ext(), dfield_set_ext(), dfield_set_null():
New functions.

dfield_copy(), dfield_copy_data(): Add const qualifiers, fix in/out comments.

data_write_sql_null(): Use memset().

big_rec_field_t: Replace byte* data with const void* data.

ut_ulint_sort(): Remove.

upd_field_t: Remove extern_storage.

upd_node_t: Replace ext_vec, n_ext_vec with n_ext.

row_merge_copy_blobs(): New function.

row_ins_index_entry(): Add the parameter "ibool foreign" for suppressing
foreign key checks during fast index creation or when inserting into
secondary indexes.

btr_page_insert_fits(): Add const qualifiers.

btr_cur_add_ext(), upd_ext_vec_contains(): Remove.

dfield_print_also_hex(), dfield_print(): Replace if...else if with switch.
Observe dfield_is_ext().
2007-06-21 09:43:15 +00:00
marko
88df83bb3b branches/zip: Merge revisions 1402:1493 from trunk.
Remove mysql.patch, because the configuration parameter interface has changed.
2007-05-14 09:07:15 +00:00
marko
fc65b08f53 branches/zip: Merge branches/fast-index-creation -r1413.
Fix some bugs.  The tests innodb and innodb-index fail, but that might
be due to an old MySQL source tree being used.
2007-04-04 11:05:33 +00:00
marko
4d6805f2a8 branches/zip: Merge revisions 1322:1402 from trunk. 2007-04-02 05:39:41 +00:00
marko
463aaf28ba branches/zip: Avoid memory fragmentation when adding column definitions
to tables.

dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
allocation.  Allow it and "name" to be NULL.  These parameters are NULL
when creating dummy indexes.

dict_add_col_name(): Remove calls to ut_malloc() and ut_free().

dict_table_get_col_name(): Allow table->col_names to be NULL.

dict_table_add_system_columns(), dict_table_add_to_cache():
Add the parameter "heap".
2007-01-30 09:24:18 +00:00
marko
5fc003b65d branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. 2007-01-18 18:29:12 +00:00
marko
8f65d7a661 branches/zip: Merge revisions 1165:1206 from trunk. 2007-01-18 12:58:39 +00:00
marko
fbe4fe6022 branches/zip: Remove the casts introduced in r920 and r925. Replace the
accessors returning pointers with macros that preserve const qualifiers.
In UNIV_DEBUG builds, retain the accessors and cast away constness there.

dfield_get_type(), dfield_get_data(), dtuple_get_nth_field(),
dict_table_get_nth_col(), dict_table_get_sys_col(): Implement as macro
unless #ifdef UNIV_DEBUG.

rec_get_nth_field(): Replace with rec_get_nth_field_offs() that does not
do pointer arithmetics.  Implement rec_get_nth_field() as a macro.
2006-10-19 07:27:26 +00:00
marko
8f07794024 branches/zip: Introduce const qualifiers to many read-only parameters
and modify some functions to return const pointers.  Add const qualifiers
to local variable declarations or casts to remove the const qualifier
in those places where write access is needed.
2006-10-17 12:24:13 +00:00
marko
68a65c142c branches/zip: Merge revisions 804:838 from trunk. 2006-09-19 10:14:07 +00:00
marko
38e09b2fea branches/zip: Merge revisions 720:765 from trunk and reindent the code
as per revisions r763:765.
2006-08-29 09:30:31 +00:00
marko
7f8cb7aab9 branches/zip: Merge revisions 583:634 from trunk. 2006-06-13 20:23:26 +00:00
marko
e47742cbef branches/zip: Merge revisions 536:558 from trunk. 2006-05-11 12:47:23 +00:00
marko
d30e44bc32 branches/zip: Merge revisions 465:532 from trunk. 2006-05-08 06:18:59 +00:00
marko
802c09ad0a branches/zip: Merge revisions 459:465 from trunk. 2006-04-12 12:39:58 +00:00
marko
0c4dfda3be branches/zip: Merge revisions 265:459 from trunk. 2006-04-12 09:32:17 +00:00
marko
e8e9fb28b4 branches/zip: Note that TRX_ID and ROLL_PTR only exist on B-tree leaf pages
of clustered indexes.  Previously, parts of the code assumed that these
columns would exist on all leaf pages.  Simplify the update-in-place of
these columns.

Add inline function dict_index_is_clust() to replace all tests
index->type & DICT_CLUSTERED.

Remove the redo log entry types MLOG_ZIP_WRITE_TRX_ID and
MLOG_ZIP_WRITE_ROLL_PTR, because the modifications to these columns
are covered by logical logging.

Fuse page_zip_write_trx_id() and page_zip_write_roll_ptr() into
page_zip_write_trx_id_and_roll_ptr().

page_zip_dir_add_slot(), page_zip_available(): Add flag "is_clustered",
so that no space will be reserved for TRX_ID and ROLL_PTR on leaf pages
of secondary indexes.

page_zip_apply_log(): Flag an error when val==0 is encoded with two bytes.

page_zip_write_rec(): Add debug assertions that there is enough space
available for the entry before copying the data bytes of the record.
2006-03-09 17:26:02 +00:00
marko
40b0bf7807 branches/zip: Merge revisions 236:247 from trunk. 2006-02-27 09:33:26 +00:00
marko
747c8fad44 branches/zip: Merge revisions 200:236 from trunk. 2006-02-23 19:25:29 +00:00
marko
dcfc19c47c branches/zip: Merge revisions 79:200 from trunk. 2006-02-17 14:19:39 +00:00
osku
2903c72469 Import 5.0 code. 2005-10-27 07:29:40 +00:00