summaryrefslogtreecommitdiff
path: root/myisammrg/myrg_open.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-22 17:40:57 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-22 17:40:57 +0300
commite7b9eabecaf2f7da05a934a5c757b438d4406bd6 (patch)
tree23349a84d09c518565222da27e0607b42d415f18 /myisammrg/myrg_open.c
parent2504336b415dfbc6f47c7666f986e2eae47921b4 (diff)
downloadmariadb-git-e7b9eabecaf2f7da05a934a5c757b438d4406bd6.tar.gz
Added support of INSERT to MERGE tables
Fixes for embedded libary and openssl BUILD/compile-pentium-debug-max: Added --with-openssl acinclude.m4: Cleanup client/client_priv.h: Include mysql_embed.h to remove not used functions in embedded server client/mysql.cc: Don't use openssl with embedded server include/Makefile.am: Move mysql_embed.h to 'include' directory include/myisammrg.h: Added support of INSERT to MERGE tables include/mysql.h: Fixes for embedded libary and openssl include/mysql_com.h: Fixes for embedded libary and openssl include/mysql_embed.h: Fixes for embedded libary and openssl include/violite.h: Cleanup libmysql/libmysql.c: Safety libmysqld/examples/Makefile.am: Fixes for embedded libary and openssl libmysqld/lib_sql.cc: Fixes for embedded libary and openssl libmysqld/lib_vio.c: Fixes for embedded libary and openssl libmysqld/libmysqld.c: Fixes for embedded libary and openssl myisammrg/Makefile.am: Added support of INSERT to MERGE tables myisammrg/myrg_create.c: Added support of INSERT to MERGE tables myisammrg/myrg_open.c: Added support of INSERT to MERGE tables myisammrg/myrg_static.c: Added support of INSERT to MERGE tables mysql-test/t/union.test: Portability fix sql/Makefile.am: Fixes for embedded libary and openssl sql/gen_lex_hash.cc: Added support of INSERT to MERGE tables sql/ha_myisammrg.cc: Added support of INSERT to MERGE tables sql/handler.h: Added support of INSERT to MERGE tables sql/mini_client.cc: Fixes for embedded libary and openssl sql/net_serv.cc: Fixes for embedded libary and openssl sql/sql_show.cc: Cleanup Build-tools/Do-all-build-steps: Don't build openssl (Need to add proper configure test when to build ssl) sql/lex.h: Added support of INSERT to MERGE tables sql/sql_yacc.yy: Fixes for embedded libary and openssl
Diffstat (limited to 'myisammrg/myrg_open.c')
-rw-r--r--myisammrg/myrg_open.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 9fa89b315ff..60523c90ff4 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* open a MYMERGE_-database */
+/* open a MyISAM MERGE table */
#include "mymrgdef.h"
#include <stddef.h>
@@ -23,17 +23,14 @@
#include "mrg_static.c"
#endif
-/* open a MYMERGE_-database.
-
+/*
+ open a MyISAM MERGE table
if handle_locking is 0 then exit with error if some database is locked
if handle_locking is 1 then wait if database is locked
*/
-MYRG_INFO *myrg_open(
-const char *name,
-int mode,
-int handle_locking)
+MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
int save_errno,i,errpos;
uint files,dir_length,length,options;
@@ -63,25 +60,34 @@ int handle_locking)
{
if ((end=buff+length)[-1] == '\n')
end[-1]='\0';
- if (buff[0] && buff[0] != '#') /* Skipp empty lines and comments */
+ if (!buff[0])
+ continue; /* Skip empty lines */
+ if (buff[0] == '#')
{
- if (!test_if_hard_path(buff))
- {
- VOID(strmake(name_buff+dir_length,buff,
- sizeof(name_buff)-1-dir_length));
- VOID(cleanup_dirname(buff,name_buff));
+ if( !strncmp(buff+1,"INSERT_METHOD=",14))
+ { /* Lookup insert method */
+ int tmp=find_type(buff+15,&merge_insert_method,2);
+ info.merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
}
- if (!(isam=mi_open(buff,mode,test(handle_locking))))
- goto err;
- files++;
- last_isam=isam;
- if (info.reclength && info.reclength != isam->s->base.reclength)
- {
- my_errno=HA_ERR_WRONG_IN_RECORD;
+ continue; /* Skip comments */
+ }
+
+ if (!test_if_hard_path(buff))
+ {
+ VOID(strmake(name_buff+dir_length,buff,
+ sizeof(name_buff)-1-dir_length));
+ VOID(cleanup_dirname(buff,name_buff));
+ }
+ if (!(isam=mi_open(buff,mode,test(handle_locking))))
goto err;
- }
- info.reclength=isam->s->base.reclength;
+ files++;
+ last_isam=isam;
+ if (info.reclength && info.reclength != isam->s->base.reclength)
+ {
+ my_errno=HA_ERR_WRONG_IN_RECORD;
+ goto err;
}
+ info.reclength=isam->s->base.reclength;
}
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO)+
files*sizeof(MYRG_TABLE),