summaryrefslogtreecommitdiff
path: root/Docs/internals.texi
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-08-29 12:31:01 +0300
committerunknown <monty@donna.mysql.com>2000-08-29 12:31:01 +0300
commit52046a7ba3c00111bf27195197b486a9ef558416 (patch)
tree8c9e3c031400ac400edcf6561fe51f4bdbd69369 /Docs/internals.texi
parent844c92364e04fb17371c4a71dee52f179f8ad253 (diff)
downloadmariadb-git-52046a7ba3c00111bf27195197b486a9ef558416.tar.gz
Bug fixes for 3.23.23
myisam/mi_debug.c: ***MISSING WEAVE*** Docs/internals.texi: Added coding guidelines Docs/manual.texi: Changelog update + Win32 -> Windows client/mysql.cc: Changed --no-named-commands to be on by default client/mysqlimport.c: Bug fix include/config-win.h: Update of supported functions include/global.h: Removed compiler warning libmysql/libmysql.c: Fix for Ia64 myisam/ChangeLog: Changelog myisam/Makefile.am: Added file mi_dbug.c myisam/ft_stopwords.c: Fix for Ia64 myisam/mi_delete_table.c: Extra debugging myisam/mi_rename.c: Extra debugging myisam/mi_rnext.c: Fixed bug with MIN and concurrent insert myisam/mi_rprev.c: Fixed bug with MAX and concurrent insert myisam/mi_search.c: Fixed bug with DECIMAL/NUMERIC keys myisam/myisamdef.h: Extra debugging scripts/make_binary_distribution.sh: Added thread safe mysql library sql/ha_heap.cc: Fix of HEAP bug with range keys sql/ha_heap.h: Fix of HEAP bug with range keys sql/handler.cc: Optimizing sql/handler.h: Optimizing sql/lock.cc: More DEBUG + fix of RENAME bug sql/mini_client.cc: Fix for Ia64 sql/mysql_priv.h: Fix for name locks sql/mysqld.cc: Shorter message if wrong options sql/opt_range.cc: Added TODO sql/sql_base.cc: Fix for DROP TABLE sql/sql_parse.cc: Fix of permission checking for CHECK TABLE sql/sql_select.cc: Fix of using LEFT JOIN with empty table sql/table.h: Fix for name locks tests/fork_test.pl: Fixed typo
Diffstat (limited to 'Docs/internals.texi')
-rw-r--r--Docs/internals.texi59
1 files changed, 59 insertions, 0 deletions
diff --git a/Docs/internals.texi b/Docs/internals.texi
index 5676fcd2bb5..532a1ebe53d 100644
--- a/Docs/internals.texi
+++ b/Docs/internals.texi
@@ -143,6 +143,65 @@ same tables.
and then we read the rows in the sorted order into a row buffer
(record_buffer) .
+@node Coding guidelines
+@chapter Coding guidelines
+
+- We are using bitkeeper (www.bitkeeper.com) for source management.
+- You should use the MySQL 3.23 or MySQL 4.0 source for all developments.
+- If you have any questions about the MySQL source, you can post these
+ to developers@mysql.com and we will answer them.
+ Note that we will shortly change the name of this list to
+ internals@mysql.com, to more accurately reflect what should be
+ posted to this list.
+
+- Try to write code in a lot of black boxes that can be reused or at
+ least have a clean interface
+- Reuse code; There is already in MySQL a lot of algorithms for list handling,
+ queues, dynamic and hashed arrays, sorting...) that can be reused.
+- Try to always write optimized code, so that you don't have to
+ go back and rewrite it a couple of months later. It's better to
+ spend 3 times as much time designing and writing and optimal function than
+ having to do it all over again later on.
+- Avoid CPU wasteful code, even where it does not matter, so that
+ you will not develop sloppy coding habits.
+- If you can write it in fewer lines, do it (as long as the code will not
+ be slower or much harder to read)
+- do not check the same pointer for NULL more than once.
+- Use long function and variable names in English; This makes your
+ code easier to read.
+- Think assembly - make it easier for the compiler to optimize your code.
+- Comment your code when you do something that someone else may think
+ is 'not trivial'.
+- Use the my_ functions like my_read/my_write/my_malloc() that you can
+ find in the mysys library instead of the direct system calls; This
+ will make your code easier to debug and more portable.
+- use libstring functions instead of standard libc string functions
+ whenever possible
+- Avoid using alloc (its REAL slow); For memory allocations that only
+ needs to live for the lifetime of one thread, on should use
+ sql_alloc() instead.
+- Before doing big design decision, please first post a summary of
+ what you want to do, why you want to do it and how you plan to do
+ it. This way we can easily provide you with feedback and also
+ easily discuss is throughly if some other developer thinks there is better
+ way to do the same thing!
+
+- Use my_var as opposed to myVar or MyVar ( _ rather than dancing SHIFT
+ to spearate words in identifiers)
+- class names start with a capital
+- structure types are typedefed to all caps identifier
+- #defines are capitalized
+- matching { are in the same column
+ - functions return 0 on success , non-zero on error, so you can do
+ if(a() || b() || c()) { error("something went wrong");}
+- goto is ok if not abused
+- avoid default variable initalizations, use LINT_INIT() if the
+ compiler complains after making sure that there is really no way
+ the variable can be used uninitialized
+- Do not instantiate a class if you do not have to
+- Use pointers rather than array indexing when operating on strings
+
+
@node Index
@unnumbered Index