Skip to content

Commit

Permalink
PG 11 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
asheshv authored and dpage committed Dec 9, 2017
1 parent 71ac998 commit 19e67c8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pldbgapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@
#include "access/htup_details.h"
#endif

#if PG_VERSION_NUM >= 110000
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
#endif

/*
* Let the PG module loader know that we are compiled against
* the right version of the PG header files
Expand Down
9 changes: 9 additions & 0 deletions pldebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ extern debugger_language_t plpgsql_debugger_lang;
extern debugger_language_t spl_debugger_lang;
#endif

#if PG_VERSION_NUM >= 110000
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
#endif

#endif
20 changes: 20 additions & 0 deletions plpgsql_debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,15 @@ plpgsql_send_vars(ErrorContextCallback *frame)
break;
}
#endif
case PLPGSQL_DTYPE_ROW:
case PLPGSQL_DTYPE_REC:
case PLPGSQL_DTYPE_RECFIELD:
case PLPGSQL_DTYPE_ARRAYELEM:
case PLPGSQL_DTYPE_EXPR:
{
/* FIXME: implement other types */
break;
}
}
}
}
Expand Down Expand Up @@ -640,7 +649,11 @@ print_rec(const PLpgSQL_execstate *frame, const char *var_name, int lineno,
{
char * extval = SPI_getvalue( tgt->tup, tgt->tupdesc, attNo + 1 );

#if PG_VERSION_NUM >= 110000
dbg_send( "v:%s.%s:%s\n", var_name, NameStr( tgt->tupdesc->attrs[attNo].attname ), extval ? extval : "NULL" );
#else
dbg_send( "v:%s.%s:%s\n", var_name, NameStr( tgt->tupdesc->attrs[attNo]->attname ), extval ? extval : "NULL" );
#endif

if( extval )
pfree( extval );
Expand Down Expand Up @@ -687,6 +700,13 @@ plpgsql_print_var(ErrorContextCallback *frame, const char *var_name,
print_recfield( estate, var_name, lineno, (PLpgSQL_recfield *) generic );
break;

case PLPGSQL_DTYPE_ARRAYELEM:
case PLPGSQL_DTYPE_EXPR:
/**
* FIXME::
* Hmm.. Shall we print the values for expression/array element?
**/
break;
}
}

Expand Down

0 comments on commit 19e67c8

Please sign in to comment.