This commit is contained in:
Vitor Santos Costa 2018-11-25 13:27:48 +00:00
parent b87f0c79e9
commit 66167abba6
6 changed files with 82 additions and 85 deletions

View File

@ -263,7 +263,7 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :-
%% sqlite3
db_open(sqlite3,Connection,File,User,Password) :-
absolute_file_name(File,Db,[,access(write),file_type(myddas),expand(true)]),
absolute_file_name(File,Db,[access(write),file_type(myddas),expand(true)]),
'$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
c_sqlite3_connect(Db,User,Password,Con),
set_value(Connection,Con).

View File

@ -98,7 +98,7 @@ db_import(Connection,RelationName,PredName0) :-
get_value(Connection,Con),
table_arity( Con, ConType, RelationName, Arity ),
strip_module(PredName0, Module, PredName),
not c_db_check_if_exists_pred(PredName,Arity,Module),
\+ c_db_check_if_exists_pred(PredName,Arity,Module),
R=..[relation,PredName,Arity,RelationName],
% assert relation fact
assert(Module:R),

View File

@ -156,7 +156,7 @@ DBMS(datalog_show_tables)(Connection) :-
% DBMS(show_tables)/2
% gives the results of the SHOW TABLES statement
% by backtracking
%#if sqlite3
#if sqlite3
DBMS(show_tables)(Connection,table(Table)) :-
'$get_value'(Connection,Conn),
SQL = 'SELECT name FROM sqlite_master WHERE type=\'table\' ORDER BY name',
@ -165,7 +165,7 @@ DBMS(show_tables)(Connection,table(Table)) :-
c_DBMS(query)(SQL,ResultSet,Conn,Mode,_),
!,
DBMS(row)(ResultSet,1,[Table]).
%#endif
#endif
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

File diff suppressed because one or more lines are too long

View File

@ -487,7 +487,7 @@ b_getval(GlobalVariable, Val) :-
b_setval('$spy_glist',[]),
'$disable_debugging'.
'$debug_restart'(state(Trace, Debug, State, SPY_GN, GList)) :-
'$debug_restore'(state(Trace, Debug, State, SPY_GN, GList)) :-
b_setval('$spy_glist',GList),
b_setval('$spy_gn',SPY_GN),
set_prolog_flag(debug, Debug),
@ -520,7 +520,7 @@ break :-
NBL is BL+1,
set_prolog_flag(break_level, NBL ),
format(user_error, '% Break (level ~w)~n', [NBL]),
'$do_live',
live,
!,
set_value('$live','$true'),
'$debug_restore'(DState),

View File

@ -109,22 +109,16 @@ error_handler(Error, Level) :-
'$process_error'('$forward'(Msg), _) :-
!,
throw( '$forward'(Msg) ).
'$process_error'(abort, Level) :-
'$process_error'(error(event(abort,I),C), Level) :-
!,
(
current_prolog_flag(break_level, 0),
Level \== top
->
throw( abort )
;
current_prolog_flag(break_level, 0)
->
print_message(informational,abort(user)),
fail
;
current_prolog_flag(break_level, I0),
I is I0-1,
current_prolog_flag(break_level, I),
throw(abort)
throw( error(event(abort,I),C) )
).
'$process_error'(error(permission_error(module,redefined,A),B), Level) :-
Level \= top, !,