From: Florian G. <re...@us...> - 2006-12-02 21:31:15
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20640/db_tools Modified Files: Makefile.in convert.c perfparse-db-tool.c Log Message: Changes in database schema: delete policy uses a id instead of name and in the other tables are only 2 entries for the delete policy. Made group editing work in php gui, started phpgui delete policy editing. Started database conversion program for new schema .... Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/Makefile.in,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile.in 17 Aug 2006 13:57:17 -0000 1.16 --- Makefile.in 2 Dec 2006 21:31:09 -0000 1.17 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ *************** *** 15,18 **** --- 15,20 ---- @SET_MAKE@ + SOURCES = $(check_perfparse_version_SOURCES) $(perfparse_db_purge_SOURCES) $(perfparse_db_tool_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** convert.c 30 Oct 2006 21:35:06 -0000 1.4 --- convert.c 2 Dec 2006 21:31:09 -0000 1.5 *************** *** 37,41 **** #include "db_macro_actions.h" #include <gettext.h> ! /* Domain to use: */ --- 37,42 ---- #include "db_macro_actions.h" #include <gettext.h> ! #include <sys/types.h> ! #include <regex.h> /* Domain to use: */ *************** *** 136,140 **** void DropForeignKey(char *TableName, char *ForeignTableName) { GString *querystr=g_string_new(""); ! GString *resultstr; g_string_printf(querystr,"show create table %s",TableName); query(querystr->str); --- 137,147 ---- void DropForeignKey(char *TableName, char *ForeignTableName) { GString *querystr=g_string_new(""); ! char *resultstr; ! regex_t *preg; ! char regex[512]; ! size_t nmatch; ! regmatch_t pmatch[10]; ! int i; ! g_string_printf(querystr,"show create table %s",TableName); query(querystr->str); *************** *** 145,150 **** for (currentRow=0;currentRow<numberOfRows;currentRow++){ #endif ! resultstr=g_string_new(result_row[0]); ! printf("Resultstring: %s\n",resultstr->str); } } --- 152,164 ---- for (currentRow=0;currentRow<numberOfRows;currentRow++){ #endif ! resultstr=result_row[0]; ! printf("Resultstring: %s\n",resultstr); ! snprintf(regex,511,"CONSTRAINT `(\\S+)` FOREIGN KEY \\S+ REFERENCES `%s`",ForeignTableName); ! printf("Using regex to find FK: %s\n",regex); ! regcomp(preg, regex,REG_EXTENDED|REG_ICASE); ! regexec(preg,resultstr,nmatch,pmatch,0); ! for (i=0;i<=nmatch;i++) { ! printf("Match %d so: %d, eo:%d\n",i,pmatch[i].rm_so,pmatch[i].rm_eo); ! } } } Index: perfparse-db-tool.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/perfparse-db-tool.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** perfparse-db-tool.c 18 Aug 2006 09:05:21 -0000 1.2 --- perfparse-db-tool.c 2 Dec 2006 21:31:09 -0000 1.3 *************** *** 4,8 **** * * Copyright (c) 2004 Ben Clewett (per...@cl...) ! * Last Modified: 2004-05-28 * * License: --- 4,8 ---- * * Copyright (c) 2004 Ben Clewett (per...@cl...) ! * $Id$ * * License: |