Index: /trunk/archive/psdb/psDB.c
===================================================================
--- /trunk/archive/psdb/psDB.c	(revision 3248)
+++ /trunk/archive/psdb/psDB.c	(revision 3249)
@@ -8,6 +8,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 00:36:11 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-17 03:20:56 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -772,6 +772,4 @@
         mType = psDBPTypeToMySQL(item->pType);
 
-        // input data length is determined by the MYSQL_TYPE_* unless it's a string
-        bind[i].buffer  = (char *)item->data.V;
         bind[i].buffer_type = mType->type;
         bind[i].is_unsigned = mType->isUnsigned;
@@ -779,27 +777,48 @@
         psFree(mType);
 
+        // input data length is determined by the MYSQL_TYPE_* unless it's a string
+        if (item->type == PS_META_PRIMITIVE) {
+            switch (item->pType) {
+                case PS_TYPE_S32:
+                    bind[i].length  = 0;
+                    bind[i].buffer  = &item->data.S32;
+                    bind[i].is_null = psDBIsPTypeNaN(item->pType, &item->data.S32) 
+                                    ? (my_bool *)&isNull
+                                    : NULL;
+                    break;
+                case PS_TYPE_F32:
+                    bind[i].length  = 0;
+                    bind[i].buffer  = &item->data.F32;
+                    bind[i].is_null = psDBIsPTypeNaN(item->pType, &item->data.F32) 
+                                    ? (my_bool *)&isNull
+                                    : NULL;
+                    break;
+                case PS_TYPE_F64:
+                    bind[i].length  = 0;
+                    bind[i].buffer  = &item->data.F64;
+                    bind[i].is_null = psDBIsPTypeNaN(item->pType, &item->data.F64) 
+                                    ? (my_bool *)&isNull
+                                    : NULL;
+                    break;
+                default:
+                    psError(PS_ERR_BAD_PARAMETER_TYPE , true,
+            "FIXME: Only PS_META_PRIMITIVE values of PS_TYPE_S32, PS_TYPE_F32, and PS_TYPE_F64 supported.");
+                    break;
+            }
         // convert NaNs to NULL and set the buffer_length for strings
-        if (item->pType == PS_TYPE_PTR) {
-            if (item->type == PS_META_STR) {
-                if (*(char *)item->data.V == '\0') {
-                    bind[i].is_null = (my_bool *)&isNull;
-                } else {
-                    bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V);
-                    bind[i].is_null = NULL;
-                }
-            } else {
-                // error, not a pointer to a string
-                psError(PS_ERR_BAD_PARAMETER_TYPE , true,
-                    "Only types of PS_META_PRIMITIVE and PS_META_STR are supported.");
-
-                psFree(cursor);
-
-                return false;
-            }
-        } else {
-            // for all primitive types
-            bind[i].is_null = psDBIsPTypeNaN(item->pType, item->data.V) 
+        } else if ((item->type == PS_META_STR) && (item->pType == PS_TYPE_PTR)) {
+            bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V);
+            bind[i].length  = &bind[i].buffer_length;
+            bind[i].buffer  = item->data.V;
+            bind[i].is_null = *(char *)item->data.V == '\0' 
                             ? (my_bool *)&isNull
                             : NULL;
+        } else {
+            psError(PS_ERR_BAD_PARAMETER_TYPE , true,
+                "Only types of PS_META_PRIMITIVE and PS_META_STR are supported.");
+
+            psFree(cursor);
+
+            return false;
         }
 
@@ -830,5 +849,4 @@
     }
 
-    // + _ + tableName + _ + (
     psStringAppend(&query, "CREATE TABLE %s (", tableName);
 
