Index: /usr/src/tinyows-svn-trom05/src/ows/ows_storage.c =================================================================== --- /usr/src/tinyows-svn-trom05/src/ows/ows_storage.c (révision 572) +++ /usr/src/tinyows-svn-trom05/src/ows/ows_storage.c (copie de travail) @@ -163,7 +163,7 @@ buffer_add_str(b, PQgetvalue(res, i, 0)); list_add(l->storage->not_null_columns, b); } - + PQclear(res); } @@ -198,17 +198,21 @@ buffer_add_str(sql, "' AND c.contype = 'p')"); res = ows_psql_exec(o, sql->buf); - if (PQresultStatus(res) != PGRES_TUPLES_OK) { + /*----------------------ENLEVER------------------*/ + /* if (PQresultStatus(res) != PGRES_TUPLES_OK) { PQclear(res); buffer_free(sql); ows_error(o, OWS_ERROR_REQUEST_SQL_FAILED, "Unable to access pg_* tables.", "pkey column"); return; - } + }*/ /* Layer could have no Pkey indeed... (An SQL view for example) */ - if (PQntuples(res) == 1) { + /*--------------- ENLEVER ON res n'est plus bon*/ + /* if (PQntuples(res) == 1) {*/ l->storage->pkey = buffer_init(); - buffer_add_str(l->storage->pkey, PQgetvalue(res, 0, 0)); + /*----------ENLEVER-------------*/ + /* buffer_add_str(l->storage->pkey, PQgetvalue(res, 0, 0));*/ + buffer_add_str(l->storage->pkey, "ogc_fid"); buffer_empty(sql); PQclear(res); @@ -218,9 +222,11 @@ buffer_copy(sql, l->storage->schema); buffer_add_str(sql, "' AND c.relname='"); buffer_copy(sql, l->storage->table); - buffer_add_str(sql, "' AND a.attname='"); - buffer_copy(sql, l->storage->pkey); - buffer_add_str(sql, "'"); + buffer_add_str(sql, "' AND a.attname='ogc_fid'"); + + /* ENLEVER -------------------- car attname est hardcodé a ogc_fid*/ + /* buffer_copy(sql, l->storage->pkey); + buffer_add_str(sql, "'");*/ res = ows_psql_exec(o, sql->buf); if (PQresultStatus(res) != PGRES_TUPLES_OK) { PQclear(res); @@ -234,7 +240,7 @@ buffer_empty(sql); PQclear(res); - /* Now try to find a sequence related to this Pkey */ + /* Now try to find a sequence related to this Pkey buffer_add_str(sql, "SELECT pg_get_serial_sequence('"); buffer_copy(sql, l->storage->schema); buffer_add_str(sql, ".\""); @@ -242,7 +248,13 @@ buffer_add_str(sql, "\"', '"); buffer_copy(sql, l->storage->pkey); buffer_add_str(sql, "');"); + */ + /*NOUVELLE FONCTION POUR aller chercher le nom de la sequence*/ + buffer_add_str(sql, "SELECT get_sequence_view('"); + buffer_copy(sql, l->storage->table); + buffer_add_str(sql, "');"); + res = ows_psql_exec(o, sql->buf); if (PQresultStatus(res) != PGRES_TUPLES_OK) { PQclear(res); @@ -259,7 +271,7 @@ l->storage->pkey_sequence = buffer_init(); buffer_add_str(l->storage->pkey_sequence, PQgetvalue(res, 0, 0)); } - } +/* }*/ PQclear(res); buffer_free(sql); Index: /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.l =================================================================== --- /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.l (révision 572) +++ /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.l (copie de travail) @@ -717,7 +717,7 @@ if (!yyin) { ows_error(map_o, OWS_ERROR_CONFIG_FILE, - "MapFile: include unable to open file", "parse_config_file"); + "MapFile: include unable to open file2", "parse_config_file"); yyterminate(); } Index: /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.c =================================================================== --- /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.c (révision 572) +++ /usr/src/tinyows-svn-trom05/src/mapfile/mapfile.c (copie de travail) @@ -1251,10 +1251,13 @@ map_md_state = MAP_MD_TOWS_DB_ENCODING; else if(!strncmp("tinyows_schema_dir", yytext, 18)) map_md_state = MAP_MD_TOWS_SCHEMA_DIR; + /* déplacer avec la vérfication "tinyows_log" comme dans le ficher mapfile.l*/ + else if (!strncmp("tinyows_log_level", yytext, 17)) + map_md_state = MAP_MD_TOWS_LOG_LEVEL; else if(!strncmp("tinyows_log", yytext, 11)) map_md_state = MAP_MD_TOWS_LOG; - else if(!strncmp("tinyows_log_level", yytext, 17)) - map_md_state = MAP_MD_TOWS_LOG_LEVEL; +/* else if(!strncmp("tinyows_log_level", yytext, 17)) + map_md_state = MAP_MD_TOWS_LOG_LEVEL;*/ else if(!strncmp("tinyows_wfs_default_version", yytext, 77)) map_md_state = MAP_MD_TOWS_WFS_DEFAULT_VERSION; else if(!strncmp("tinyows_degree_precision", yytext, 24)) @@ -2445,10 +2448,10 @@ { char *p, *q; - buffer *path; - + buffer *path; + yy_pop_state(); OWS_MAP_DBG - +/* MODIF */ if(map_include_stack_ptr >= OWS_MAP_MAX_INCLUDE_DEPTH) { ows_error(map_o, OWS_ERROR_CONFIG_FILE, "MapFile: include nested too deeply", "parse_config_file"); @@ -2463,9 +2466,10 @@ yyin = fopen(path->buf, "r"); buffer_free(path); + /*MODIF*/ if (!yyin) { ows_error(map_o, OWS_ERROR_CONFIG_FILE, - "MapFile: include unable to open file", "parse_config_file"); + q, "parse_config_file"); yyterminate(); }