summaryrefslogtreecommitdiff
blob: 18f214b7f74e934f1f97023a9efbbe4fbe6666cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff -ur XSB.orig/packages/dbdrivers/mysql/cc/mysql_driver.c XSB/packages/dbdrivers/mysql/cc/mysql_driver.c
--- XSB.orig/packages/dbdrivers/mysql/cc/mysql_driver.c	2006-02-12 18:21:03.000000000 +1300
+++ XSB/packages/dbdrivers/mysql/cc/mysql_driver.c	2007-11-25 13:44:50.000000000 +1300
@@ -209,13 +209,11 @@
 		switch (result[i]->type)
 		{
 			case INT_TYPE:
-					result[i]->val->i_val = (int *)malloc(sizeof(int));
-					result[i]->val->i_val = (int *)row[i];
+					sscanf(row[i], "%d", &result[i]->val->i_val);
 					break;
 
 			case FLOAT_TYPE:
-					result[i]->val->f_val = (double *)malloc(sizeof(double));
-					result[i]->val->f_val = (double *)row[i];
+					sscanf(row[i], "%lf", &result[i]->val->f_val);
 					break;
 
 			case STRING_TYPE:
diff -ur XSB.orig/packages/dbdrivers/mysql/configure XSB/packages/dbdrivers/mysql/configure
--- XSB.orig/packages/dbdrivers/mysql/configure	2003-09-29 21:40:02.000000000 +1200
+++ XSB/packages/dbdrivers/mysql/configure	2007-11-25 13:53:22.000000000 +1300
@@ -626,8 +626,8 @@
    LDFLAGS="-L${libdir} ${LDFLAGS}"
 fi
 
-echo $ac_n "checking for  in -lmysqlclient""... $ac_c" 1>&6
-echo "configure:631: checking for  in -lmysqlclient" >&5
+echo $ac_n "checking for mysql_init in -lmysqlclient""... $ac_c" 1>&6
+echo "configure:631: checking for mysql_init in -lmysqlclient" >&5
 ac_lib_var=`echo mysqlclient'_' | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -640,10 +640,10 @@
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char ();
+char mysql_init ();
 
 int main() {
-()
+mysql_init()
 ; return 0; }
 EOF
 if { (eval echo configure:650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
@@ -661,9 +661,9 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  mysql_error=yes
 else
   echo "$ac_t""no" 1>&6
+  mysql_error=yes
 fi
 
 # Here we provide additional directories to check headers in
@@ -808,6 +808,8 @@
 support=yes
 fi
 
+CFLAGS=`mysql_config --cflags`
+LDFLAGS=`mysql_config --libs`
 
 
 
diff -ur XSB.orig/packages/dbdrivers/mysql.P XSB/packages/dbdrivers/mysql.P
--- XSB.orig/packages/dbdrivers/mysql.P	2007-08-10 02:50:45.000000000 +1200
+++ XSB/packages/dbdrivers/mysql.P	2007-11-25 13:53:54.000000000 +1300
@@ -35,7 +35,7 @@
 	fmt_write_string(Dir, 'dbdrivers%smysql', a(Slash)),
 	bootstrap_package([Dir,cc], mysql_driver),
 	%% TEMPORARILY DISABLED
-	abort('*** The native MySQL driver is not yet operational'),
+	%% abort('*** The native MySQL driver is not yet operational'),
 	[mysql_driver_config],
 	driverMySQL_register,
 	driverMySQL_initialise.