summaryrefslogtreecommitdiff
path: root/src/bin/pgbench/pgbench.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pgbench/pgbench.h')
-rw-r--r--src/bin/pgbench/pgbench.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index 46350aace10..7dcb67f5203 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -28,10 +28,31 @@
*/
union YYSTYPE;
+/*
+ * Variable types used in parser.
+ */
+typedef enum
+{
+ PGBT_INT,
+ PGBT_DOUBLE
+ /* add other types here */
+} PgBenchValueType;
+
+typedef struct
+{
+ PgBenchValueType type;
+ union
+ {
+ int64 ival;
+ double dval;
+ /* add other types here */
+ } u;
+} PgBenchValue;
+
/* Types of expression nodes */
typedef enum PgBenchExprType
{
- ENODE_INTEGER_CONSTANT,
+ ENODE_CONSTANT,
ENODE_VARIABLE,
ENODE_FUNCTION
} PgBenchExprType;
@@ -48,6 +69,13 @@ typedef enum PgBenchFunction
PGBENCH_ABS,
PGBENCH_MIN,
PGBENCH_MAX,
+ PGBENCH_INT,
+ PGBENCH_DOUBLE,
+ PGBENCH_PI,
+ PGBENCH_SQRT,
+ PGBENCH_RANDOM,
+ PGBENCH_RANDOM_GAUSSIAN,
+ PGBENCH_RANDOM_EXPONENTIAL
} PgBenchFunction;
typedef struct PgBenchExpr PgBenchExpr;
@@ -59,10 +87,7 @@ struct PgBenchExpr
PgBenchExprType etype;
union
{
- struct
- {
- int64 ival;
- } integer_constant;
+ PgBenchValue constant;
struct
{
char *varname;