~psycopg/psycopg/2.0.x

« back to all changes in this revision

Viewing changes to psycopg/adapter_datetime.c

  • Committer: Federico Di Gregorio
  • Date: 2007-09-19 13:39:48 UTC
  • Revision ID: fog-10ac3c3a9634bc9f19ed31725d276fa79127f1c1
Aggressive threading on fetch (and a new bug!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    else {
65
65
        PyDateTime_Delta *obj = (PyDateTime_Delta*)self->wrapped;
66
66
 
67
 
        char buffer[8];
 
67
        char buffer[8]; 
68
68
        int i;
69
69
        int a = obj->microseconds;
70
70
 
128
128
{
129
129
    Dprintf("pydatetime_setup: init datetime object at %p, refcnt = "
130
130
        FORMAT_CODE_PY_SSIZE_T,
131
 
        self, ((PyObject *)self)->ob_refcnt
132
 
      );
 
131
        self, ((PyObject *)self)->ob_refcnt);
133
132
 
134
133
    self->type = type;
135
134
    self->wrapped = obj;
137
136
 
138
137
    Dprintf("pydatetime_setup: good pydatetime object at %p, refcnt = "
139
138
        FORMAT_CODE_PY_SSIZE_T,
140
 
        self, ((PyObject *)self)->ob_refcnt
141
 
      );
 
139
        self, ((PyObject *)self)->ob_refcnt);
142
140
    return 0;
143
141
}
144
142
 
411
409
        args = Py_BuildValue("iiiiidO",
412
410
                             tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
413
411
                             tm.tm_hour, tm.tm_min,
414
 
                 (double)tm.tm_sec + ticks,
 
412
                             (double)tm.tm_sec + ticks,
415
413
                             pyPsycopgTzLOCAL);
416
414
        if (args) {
 
415
/*            Dprintf("psyco_TimestampFromTicks: args->refcnt = %d", args->ob_refcnt);*/
417
416
            res = psyco_Timestamp(self, args);
418
417
            Py_DECREF(args);
419
418
        }