Skip to content

Commit

Permalink
Patch to v2.4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrahn committed Mar 3, 2017
1 parent 3743f32 commit 2ec45c5
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 33 deletions.
2 changes: 2 additions & 0 deletions query_templates/ansi.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
define __LIMITA = "";
define __LIMITB = "top %d";
define __LIMITC = "";
define _BEGIN = "-- start query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
2 changes: 2 additions & 0 deletions query_templates/db2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
define __LIMITA = "";
define __LIMITB = "";
define __LIMITC = " fetch first %d rows only";
define _BEGIN = "-- start query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
2 changes: 2 additions & 0 deletions query_templates/netezza.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
define __LIMITA = "";
define __LIMITB = "";
define __LIMITC = "limit %d";
define _BEGIN = "-- start query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
2 changes: 2 additions & 0 deletions query_templates/oracle.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
define __LIMITA = "select * from (";
define __LIMITB = "";
define __LIMITC = " ) where rownum <= %d";
define _BEGIN = "-- start query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
2 changes: 2 additions & 0 deletions query_templates/sqlserver.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
define __LIMITA = "";
define __LIMITB = "top %d";
define __LIMITC = "";
define _BEGIN = "-- start query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE];
27 changes: 17 additions & 10 deletions tools/Makefile.suite
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
################
## TARGET OS HERE
################
# OS Values: AIX, LINUX, SOLARIS, NCR, HPUX
OS = LINUX
# OS Values: AIX, LINUX, SOLARIS, NCR, HPUX, MACOS
OS = LINUX
###########
# No changes should be necessary below this point
# Each compile variable is adjusted for the target platform using the OS setting above
###########
# CC
AIX_CC = xlC
HPUX_CC = gcc
LINUX_CC = gcc
LINUX_CC = gcc
NCR_CC = cc
MACOS_CC = gcc
SOLARIS_CC = gcc
SOL86_CC = cc
CC = $($(OS)_CC)
Expand All @@ -57,31 +58,35 @@ AIX_CFLAGS = -q64 -O3 -D_LARGE_FILES
HPUX_CFLAGS = -O3 -Wall
LINUX_CFLAGS = -g -Wall
NCR_CFLAGS = -g
MACOS_CFLAGS = -g -Wall
SOLARIS_CFLAGS = -O3 -Wall
SOL86_CFLAGS = -O3
BASE_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DYYDEBUG #-maix64 -DMEM_TEST
BASE_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DYYDEBUG #-maix64 -DMEM_TEST
CFLAGS = $(BASE_CFLAGS) -D$(OS) $($(OS)_CFLAGS)
# EXE
AIX_EXE =
AIX_EXE =
HPUX_EXE =
LINUX_EXE =
NCR_EXE =
MACOS_EXE =
SOLARIS_EXE =
SOL86_EXE =
EXE = $($(OS)_EXE)
EXE = $($(OS)_EXE)
# LEX
AIX_LEX = flex
HPUX_LEX = flex
LINUX_LEX = lex
NCR_LEX = lex
MACOS_LEX = lex
SOLARIS_LEX = lex
SOL86_LEX = lex
LEX = $($(OS)_LEX)
LEX = $($(OS)_LEX)
# LIBS
AIX_LIBS = -lm
HPUX_LIBS = -lm -ll
LINUX_LIBS = -lm
NCR_LIBS = -lm -lc89
MACOS_LIBS = -lm
SOLARIS_LIBS = -ly -ll -lm
SOL86_LIBS = -ly -ll -lm
LIBS = $($(OS)_LIBS)
Expand All @@ -90,6 +95,7 @@ AIX_YACC = yacc
HPUX_YACC = bison -y
LINUX_YACC = yacc
NCR_YACC = yacc
MACOS_YACC = yacc
SOLARIS_YACC = yacc
SOL86_YACC = yacc
YACC = $($(OS)_YACC)
Expand All @@ -98,6 +104,7 @@ AIX_YFLAGS = -d -v
HPUX_YFLAGS = -y -d -v
LINUX_YFLAGS = -d -v
NCR_YFLAGS = -d -v
MACOS_YFLAGS = -d -v
SOLARIS_YFLAGS = -d -v
SOL86_YFLAGS = -d -v
YFLAGS = $($(OS)_YFLAGS)
Expand Down Expand Up @@ -221,7 +228,7 @@ TESTS = tests/*.sh tests/*.sql
ANS = answer_sets/*.ans
QUERY_SRC = $(FQD) $(VARIANTS)
TREE_DOC =
JUNK = tags *.idx columns.h streams.h y.tab.h y.tab.c tokenizer.c \
JUNK = tags *.idx columns.h streams.h tables.h y.tab.h y.tab.c tokenizer.c \
y.output .ctags_updated tpcds.idx.h
DBGENSRC = $(SRC) $(HDR) $(OTHER) $(DOC) $(DDL) $(IDXSRC) $(WIN_MAKE) $(QUERY_SRC) $(TESTS) $(ANS)
GENERATED = tables.h streams.h columns.h
Expand Down Expand Up @@ -250,10 +257,10 @@ clean:
current_source:
cvs update
depend: $(SRC) $(HDR)
touch columns.h streams.h
touch columns.h streams.h tables.h
-makedepend -f Makefile.suite -Y -- $(CFLAGS) -- $(SRC) 2> /dev/null
date > .depend_updated
rm -f columns.h streams.h
rm -f columns.h streams.h tables.h
lint:
lint $(CFLAGS) -u -x -wO -p $(SRC1)
lint $(CFLAGS) -u -x -wO -p $(SRC2)
Expand Down
10 changes: 10 additions & 0 deletions tools/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
#ifndef CONFIG_H
#define CONFIG_H

#ifdef MACOS
#define SUPPORT_64BITS
#define HUGE_TYPE int64_t
#define HUGE_FORMAT "%lld"
#define HUGE_COUNT 1
#define USE_STRING_H
#define USE_STDLIB_H
#define FLEX
#endif /* MACOS */

#ifdef NCR
#define STDLIB_HAS_GETOPT
#define USE_STRING_H
Expand Down
4 changes: 2 additions & 2 deletions tools/date.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
*/

/*** includes ***/
#include "config.h"
#include "porting.h"
#include <stdlib.h>
#ifndef USE_STDLIB_H
#include <malloc.h>
#endif
#include <stdio.h>
#include <math.h>
#include "config.h"
#include "porting.h"
#include "date.h"
#include "mathops.h"
#include "dist.h"
Expand Down
1 change: 0 additions & 1 deletion tools/dist.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
#include <malloc.h>
#ifdef WIN32
#include <io.h>
#include <stdlib.h>
Expand Down
27 changes: 17 additions & 10 deletions tools/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
################
## TARGET OS HERE
################
# OS Values: AIX, LINUX, SOLARIS, NCR, HPUX
OS = LINUX
# OS Values: AIX, LINUX, SOLARIS, NCR, HPUX, MACOS
OS = LINUX
###########
# No changes should be necessary below this point
# Each compile variable is adjusted for the target platform using the OS setting above
###########
# CC
AIX_CC = xlC
HPUX_CC = gcc
LINUX_CC = gcc
LINUX_CC = gcc
NCR_CC = cc
MACOS_CC = gcc
SOLARIS_CC = gcc
SOL86_CC = cc
CC = $($(OS)_CC)
Expand All @@ -57,31 +58,35 @@ AIX_CFLAGS = -q64 -O3 -D_LARGE_FILES
HPUX_CFLAGS = -O3 -Wall
LINUX_CFLAGS = -g -Wall
NCR_CFLAGS = -g
MACOS_CFLAGS = -g -Wall
SOLARIS_CFLAGS = -O3 -Wall
SOL86_CFLAGS = -O3
BASE_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DYYDEBUG #-maix64 -DMEM_TEST
BASE_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DYYDEBUG #-maix64 -DMEM_TEST
CFLAGS = $(BASE_CFLAGS) -D$(OS) $($(OS)_CFLAGS)
# EXE
AIX_EXE =
AIX_EXE =
HPUX_EXE =
LINUX_EXE =
NCR_EXE =
MACOS_EXE =
SOLARIS_EXE =
SOL86_EXE =
EXE = $($(OS)_EXE)
EXE = $($(OS)_EXE)
# LEX
AIX_LEX = flex
HPUX_LEX = flex
LINUX_LEX = lex
NCR_LEX = lex
MACOS_LEX = lex
SOLARIS_LEX = lex
SOL86_LEX = lex
LEX = $($(OS)_LEX)
LEX = $($(OS)_LEX)
# LIBS
AIX_LIBS = -lm
HPUX_LIBS = -lm -ll
LINUX_LIBS = -lm
NCR_LIBS = -lm -lc89
MACOS_LIBS = -lm
SOLARIS_LIBS = -ly -ll -lm
SOL86_LIBS = -ly -ll -lm
LIBS = $($(OS)_LIBS)
Expand All @@ -90,6 +95,7 @@ AIX_YACC = yacc
HPUX_YACC = bison -y
LINUX_YACC = yacc
NCR_YACC = yacc
MACOS_YACC = yacc
SOLARIS_YACC = yacc
SOL86_YACC = yacc
YACC = $($(OS)_YACC)
Expand All @@ -98,6 +104,7 @@ AIX_YFLAGS = -d -v
HPUX_YFLAGS = -y -d -v
LINUX_YFLAGS = -d -v
NCR_YFLAGS = -d -v
MACOS_YFLAGS = -d -v
SOLARIS_YFLAGS = -d -v
SOL86_YFLAGS = -d -v
YFLAGS = $($(OS)_YFLAGS)
Expand Down Expand Up @@ -221,7 +228,7 @@ TESTS = tests/*.sh tests/*.sql
ANS = answer_sets/*.ans
QUERY_SRC = $(FQD) $(VARIANTS)
TREE_DOC =
JUNK = tags *.idx columns.h streams.h y.tab.h y.tab.c tokenizer.c \
JUNK = tags *.idx columns.h streams.h tables.h y.tab.h y.tab.c tokenizer.c \
y.output .ctags_updated tpcds.idx.h
DBGENSRC = $(SRC) $(HDR) $(OTHER) $(DOC) $(DDL) $(IDXSRC) $(WIN_MAKE) $(QUERY_SRC) $(TESTS) $(ANS)
GENERATED = tables.h streams.h columns.h
Expand Down Expand Up @@ -250,10 +257,10 @@ clean:
current_source:
cvs update
depend: $(SRC) $(HDR)
touch columns.h streams.h
touch columns.h streams.h tables.h
-makedepend -f Makefile.suite -Y -- $(CFLAGS) -- $(SRC) 2> /dev/null
date > .depend_updated
rm -f columns.h streams.h
rm -f columns.h streams.h tables.h
lint:
lint $(CFLAGS) -u -x -wO -p $(SRC1)
lint $(CFLAGS) -u -x -wO -p $(SRC2)
Expand Down
4 changes: 2 additions & 2 deletions tools/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
#include <errno.h>
#include <ctype.h>
#include <math.h>
#ifndef _POSIX_SOURCE
#ifndef USE_STDLIB_H
#include <malloc.h>
#endif /* POSIX_SOURCE */
#endif
#include <fcntl.h>
#ifdef AIX
#include <sys/mode.h>
Expand Down
4 changes: 4 additions & 0 deletions tools/porting.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ char *strdup(const char *);
#define MAXINT INT_MAX
#endif

#ifdef MACOS
#include <limits.h>
#define MAXINT INT_MAX
#endif /* MACOS */

#define INTERNAL(m) {\
fprintf(stderr, "ERROR: %s\n\tFile: %s\n\tLine: %d\n", \
Expand Down
2 changes: 2 additions & 0 deletions tools/tokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
#else
#include <strings.h>
#endif
#ifndef USE_STDLIB_H
#include <malloc.h>
#endif
#include "keywords.h"
#include "StringBuffer.h"
#include "expr.h"
Expand Down
4 changes: 2 additions & 2 deletions tools/tpcds.dst
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ add ("COMOROS":1);
--add ("CONGO, THE DEMOCRATIC REPUBLIC OF THE":1);
add ("add ("COOK ISLANDS":1);
add ("COSTA RICA":1);
add ("C�TE D'IVOIRE":1);
add ("CÔTE D'IVOIRE":1);
add ("CROATIA":1);
add ("CUBA":1);
add ("CYPRUS":1);
Expand Down Expand Up @@ -771,7 +771,7 @@ add ("POLAND":1);
add ("PORTUGAL":1);
add ("PUERTO RICO":1);
add ("QATAR":1);
add ("R�UNION":1);
add ("RÉUNION":1);
add ("ROMANIA":1);
add ("RUSSIAN FEDERATION":1);
add ("RWANDA":1);
Expand Down
10 changes: 5 additions & 5 deletions tools/tpcds_ri.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
alter table call_center add constraint cc_d1 foreign key (cc_closed_date_sk) references date_dim (d_date_sk);
alter table call_center add constraint cc_d2 foreign key (cc_open_date_sk) references date_dim (d_date_sk);
alter table catalog_page add constraint cp_d1 foreign key (cp_end_date_sk) references date_dim (d_date_sk);
alter table catalog_page add constraint cp_p foreign key (cp_promo_id) references promotion (p_promo_sk);
-- alter table catalog_page add constraint cp_p foreign key (cp_promo_id) references promotion (p_promo_sk);
alter table catalog_page add constraint cp_d2 foreign key (cp_start_date_sk) references date_dim (d_date_sk);
alter table catalog_returns add constraint cr_cc foreign key (cr_call_center_sk) references call_center (cc_call_center_sk);
alter table catalog_returns add constraint cr_cp foreign key (cr_catalog_page_sk) references catalog_page (cp_catalog_page_sk);
Expand All @@ -47,12 +47,12 @@ alter table catalog_returns add constraint cr_cd1 foreign key (cr_refunded_cdem
alter table catalog_returns add constraint cr_c1 foreign key (cr_refunded_customer_sk) references customer (c_customer_sk);
alter table catalog_returns add constraint cr_hd1 foreign key (cr_refunded_hdemo_sk) references household_demographics (hd_demo_sk);
alter table catalog_returns add constraint cr_d1 foreign key (cr_returned_date_sk) references date_dim (d_date_sk);
alter table catalog_returns add constraint cr_i foreign key (cr_returned_time_sk) references time_dim (t_time_sk);
alter table catalog_returns add constraint cr_t foreign key (cr_returned_time_sk) references time_dim (t_time_sk);
alter table catalog_returns add constraint cr_a2 foreign key (cr_returning_addr_sk) references customer_address (ca_address_sk);
alter table catalog_returns add constraint cr_cd2 foreign key (cr_returning_cdemo_sk) references customer_demographics (cd_demo_sk);
alter table catalog_returns add constraint cr_c2 foreign key (cr_returning_customer_sk) references customer (c_customer_sk);
alter table catalog_returns add constraint cr_hd2 foreign key (cr_returning_hdemo_sk) references household_demographics (hd_demo_sk);
alter table catalog_returns add constraint cr_d2 foreign key (cr_ship_date_sk) references date_dim (d_date_sk);
-- alter table catalog_returns add constraint cr_d2 foreign key (cr_ship_date_sk) references date_dim (d_date_sk);
alter table catalog_returns add constraint cr_sm foreign key (cr_ship_mode_sk) references ship_mode (sm_ship_mode_sk);
alter table catalog_returns add constraint cr_w2 foreign key (cr_warehouse_sk) references warehouse (w_warehouse_sk);
alter table catalog_sales add constraint cs_b_a foreign key (cs_bill_addr_sk) references customer_address (ca_address_sk);
Expand Down Expand Up @@ -116,12 +116,12 @@ alter table web_returns add constraint wr_ret_t foreign key (wr_returned_time_s
alter table web_returns add constraint wr_ret_a foreign key (wr_returning_addr_sk) references customer_address (ca_address_sk);
alter table web_returns add constraint wr_ret_cd foreign key (wr_returning_cdemo_sk) references customer_demographics (cd_demo_sk);
alter table web_returns add constraint wr_ret_c foreign key (wr_returning_customer_sk) references customer (c_customer_sk);
alter table web_returns add constraint wr_ret_cd foreign key (wr_returning_hdemo_sk) references household_demographics (hd_demo_sk);
alter table web_returns add constraint wr_ret_hd foreign key (wr_returning_hdemo_sk) references household_demographics (hd_demo_sk);
alter table web_returns add constraint wr_wp foreign key (wr_web_page_sk) references web_page (wp_web_page_sk);
alter table web_sales add constraint ws_b_a foreign key (ws_bill_addr_sk) references customer_address (ca_address_sk);
alter table web_sales add constraint ws_b_cd foreign key (ws_bill_cdemo_sk) references customer_demographics (cd_demo_sk);
alter table web_sales add constraint ws_b_c foreign key (ws_bill_customer_sk) references customer (c_customer_sk);
alter table web_sales add constraint ws_b_cd foreign key (ws_bill_hdemo_sk) references household_demographics (hd_demo_sk);
alter table web_sales add constraint ws_b_hd foreign key (ws_bill_hdemo_sk) references household_demographics (hd_demo_sk);
alter table web_sales add constraint ws_i foreign key (ws_item_sk) references item (i_item_sk);
alter table web_sales add constraint ws_p foreign key (ws_promo_sk) references promotion (p_promo_sk);
alter table web_sales add constraint ws_s_a foreign key (ws_ship_addr_sk) references customer_address (ca_address_sk);
Expand Down
2 changes: 1 addition & 1 deletion tools/w_store_sales.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* Gradient Systems
*/
#ifndef W_STORE_SALES_H
#define W_STORE_SLAES_H
#define W_STORE_SALES_H

#include "constants.h"
#include "pricing.h"
Expand Down

0 comments on commit 2ec45c5

Please sign in to comment.