Fri, 29 Jun 2012 17:45:37 +0100
MySQL: Avoid allocating the full column size to receive results, for variable-length types check result size before allocation (thanks Florob)
1 | 1 | CC=gcc |
33 | 2 | CFLAGS=-g -pedantic -Wall -O2 -shared -fpic -I /usr/include/lua5.1 -I /usr/include/mysql -I /usr/include/postgresql/ -I /opt/ibm/db2exc/V9.5/include/ -I /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/ -I . |
1 | 3 | AR=ar rcu |
4 | RANLIB=ranlib | |
39 | 5 | RM=rm -rf |
6 | MKDIR=mkdir -p | |
1 | 7 | |
8 | COMMON_LDFLAGS= | |
9 | MYSQL_LDFLAGS=$(COMMON_LDFLAGS) -lmysqlclient | |
10 | PSQL_LDFLAGS=$(COMMON_LDFLAGS) -lpq | |
11 | SQLITE3_LDFLAGS=$(COMMON_LDFLAGS) -lsqlite3 | |
18 | 12 | DB2_LDFLAGS=$(COMMON_LDFLAGS) -L/opt/ibm/db2exc/V9.5/lib64 -L/opt/ibm/db2exc/V9.5/lib32 -ldb2 |
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
13 | ORACLE_LDFLAGS=$(COMMON_LDFLAGS) -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/ -locixe |
1 | 14 | |
39 | 15 | BUILDDIR=build |
16 | ||
1 | 17 | DBDMYSQL=dbdmysql.so |
18 | DBDPSQL=dbdpostgresql.so | |
19 | DBDSQLITE3=dbdsqlite3.so | |
14 | 20 | DBDDB2=dbddb2.so |
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
21 | DBDORACLE=dbdoracle.so |
1 | 22 | |
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
23 | OBJS=build/dbd_common.o |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
24 | MYSQL_OBJS=$(OBJS) build/dbd_mysql_main.o build/dbd_mysql_connection.o build/dbd_mysql_statement.o |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
25 | PSQL_OBJS=$(OBJS) build/dbd_postgresql_main.o build/dbd_postgresql_connection.o build/dbd_postgresql_statement.o |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
26 | SQLITE3_OBJS=$(OBJS) build/dbd_sqlite3_main.o build/dbd_sqlite3_connection.o build/dbd_sqlite3_statement.o |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
27 | DB2_OBJS=$(OBJS) build/dbd_db2_main.o build/dbd_db2_connection.o build/dbd_db2_statement.o |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
28 | ORACLE_OBJS=$(OBJS) build/dbd_oracle_main.o build/dbd_oracle_connection.o build/dbd_oracle_statement.o |
1 | 29 | |
21
7956401a0c5e
Added the statement:affected() and statement:rowcount() methods.
nrich@ii.net
parents:
20
diff
changeset
|
30 | free: mysql psql sqlite3 |
14 | 31 | |
21
7956401a0c5e
Added the statement:affected() and statement:rowcount() methods.
nrich@ii.net
parents:
20
diff
changeset
|
32 | all: mysql psql sqlite3 db2 oracle |
1 | 33 | |
39 | 34 | mysql: $(BUILDDIR) $(MYSQL_OBJS) |
1 | 35 | $(CC) $(CFLAGS) $(MYSQL_OBJS) -o $(DBDMYSQL) $(MYSQL_LDFLAGS) |
36 | ||
39 | 37 | psql: $(BUILDDIR) $(PSQL_OBJS) |
1 | 38 | $(CC) $(CFLAGS) $(PSQL_OBJS) -o $(DBDPSQL) $(PSQL_LDFLAGS) |
39 | ||
39 | 40 | sqlite3: $(BUILDDIR) $(SQLITE3_OBJS) |
1 | 41 | $(CC) $(CFLAGS) $(SQLITE3_OBJS) -o $(DBDSQLITE3) $(SQLITE3_LDFLAGS) |
42 | ||
39 | 43 | db2: $(BUILDDIR) $(DB2_OBJS) |
14 | 44 | $(CC) $(CFLAGS) $(DB2_OBJS) -o $(DBDDB2) $(DB2_LDFLAGS) |
45 | ||
39 | 46 | oracle: $(BUILDDIR) $(ORACLE_OBJS) |
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
47 | $(CC) $(CFLAGS) $(ORACLE_OBJS) -o $(DBDORACLE) $(ORACLE_LDFLAGS) |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
48 | |
1 | 49 | clean: |
39 | 50 | $(RM) $(BUILDDIR) $(MYSQL_OBJS) $(PSQL_OBJS) $(SQLITE3_OBJS) $(DB2_OBJS) $(ORACLE_OBJS) $(DBDMYSQL) $(DBDPSQL) $(DBDSQLITE3) $(DBDDB2) $(DBDORACLE) |
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
51 | |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
52 | build/dbd_common.o: dbd/common.c dbd/common.h |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
53 | $(CC) -c -o $@ $< $(CFLAGS) |
1 | 54 | |
55 | build/dbd_mysql_connection.o: dbd/mysql/connection.c dbd/mysql/dbd_mysql.h dbd/common.h | |
56 | $(CC) -c -o $@ $< $(CFLAGS) | |
57 | build/dbd_mysql_main.o: dbd/mysql/main.c dbd/mysql/dbd_mysql.h dbd/common.h | |
58 | $(CC) -c -o $@ $< $(CFLAGS) | |
59 | build/dbd_mysql_statement.o: dbd/mysql/statement.c dbd/mysql/dbd_mysql.h dbd/common.h | |
60 | $(CC) -c -o $@ $< $(CFLAGS) | |
61 | ||
62 | build/dbd_postgresql_connection.o: dbd/postgresql/connection.c dbd/postgresql/dbd_postgresql.h dbd/common.h | |
63 | $(CC) -c -o $@ $< $(CFLAGS) | |
64 | build/dbd_postgresql_main.o: dbd/postgresql/main.c dbd/postgresql/dbd_postgresql.h dbd/common.h | |
65 | $(CC) -c -o $@ $< $(CFLAGS) | |
66 | build/dbd_postgresql_statement.o: dbd/postgresql/statement.c dbd/postgresql/dbd_postgresql.h dbd/common.h | |
67 | $(CC) -c -o $@ $< $(CFLAGS) | |
68 | ||
69 | build/dbd_sqlite3_connection.o: dbd/sqlite3/connection.c dbd/sqlite3/dbd_sqlite3.h dbd/common.h | |
70 | $(CC) -c -o $@ $< $(CFLAGS) | |
71 | build/dbd_sqlite3_main.o: dbd/sqlite3/main.c dbd/sqlite3/dbd_sqlite3.h dbd/common.h | |
72 | $(CC) -c -o $@ $< $(CFLAGS) | |
73 | build/dbd_sqlite3_statement.o: dbd/sqlite3/statement.c dbd/sqlite3/dbd_sqlite3.h dbd/common.h | |
74 | $(CC) -c -o $@ $< $(CFLAGS) | |
75 | ||
14 | 76 | build/dbd_db2_connection.o: dbd/db2/connection.c dbd/db2/dbd_db2.h dbd/common.h |
77 | $(CC) -c -o $@ $< $(CFLAGS) | |
78 | build/dbd_db2_main.o: dbd/db2/main.c dbd/db2/dbd_db2.h dbd/common.h | |
79 | $(CC) -c -o $@ $< $(CFLAGS) | |
80 | build/dbd_db2_statement.o: dbd/db2/statement.c dbd/db2/dbd_db2.h dbd/common.h | |
81 | $(CC) -c -o $@ $< $(CFLAGS) | |
82 | ||
17
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
83 | build/dbd_oracle_connection.o: dbd/oracle/connection.c dbd/oracle/dbd_oracle.h dbd/common.h |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
84 | $(CC) -c -o $@ $< $(CFLAGS) |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
85 | build/dbd_oracle_main.o: dbd/oracle/main.c dbd/oracle/dbd_oracle.h dbd/common.h |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
86 | $(CC) -c -o $@ $< $(CFLAGS) |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
87 | build/dbd_oracle_statement.o: dbd/oracle/statement.c dbd/oracle/dbd_oracle.h dbd/common.h |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
88 | $(CC) -c -o $@ $< $(CFLAGS) |
21c4feaeafe7
Added initial Oracle driver support - functionality is complete, but may be too buggy in its current state for any serious use.
nrich@ii.net
parents:
15
diff
changeset
|
89 | |
39 | 90 | build: |
91 | $(MKDIR) ${BUILDDIR} | |
92 |