Commit 309411a6 authored by Michael Meskes's avatar Michael Meskes

Applied Zoltan's patch to correctly align interval and timestamp data in ecpg's sqlda.

parent 4509033a
...@@ -127,10 +127,10 @@ sqlda_common_total_size(const PGresult *res, int row, enum COMPAT_MODE compat, l ...@@ -127,10 +127,10 @@ sqlda_common_total_size(const PGresult *res, int row, enum COMPAT_MODE compat, l
ecpg_sqlda_align_add_size(offset, sizeof(date), sizeof(date), &offset, &next_offset); ecpg_sqlda_align_add_size(offset, sizeof(date), sizeof(date), &offset, &next_offset);
break; break;
case ECPGt_timestamp: case ECPGt_timestamp:
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(timestamp), &offset, &next_offset); ecpg_sqlda_align_add_size(offset, sizeof(int64), sizeof(timestamp), &offset, &next_offset);
break; break;
case ECPGt_interval: case ECPGt_interval:
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(interval), &offset, &next_offset); ecpg_sqlda_align_add_size(offset, sizeof(int64), sizeof(interval), &offset, &next_offset);
break; break;
case ECPGt_char: case ECPGt_char:
case ECPGt_unsigned_char: case ECPGt_unsigned_char:
...@@ -359,7 +359,7 @@ ecpg_set_compat_sqlda(int lineno, struct sqlda_compat ** _sqlda, const PGresult ...@@ -359,7 +359,7 @@ ecpg_set_compat_sqlda(int lineno, struct sqlda_compat ** _sqlda, const PGresult
sqlda->sqlvar[i].sqllen = sizeof(date); sqlda->sqlvar[i].sqllen = sizeof(date);
break; break;
case ECPGt_timestamp: case ECPGt_timestamp:
ecpg_sqlda_align_add_size(offset, sizeof(timestamp), sizeof(timestamp), &offset, &next_offset); ecpg_sqlda_align_add_size(offset, sizeof(int64), sizeof(timestamp), &offset, &next_offset);
sqlda->sqlvar[i].sqldata = (char *) sqlda + offset; sqlda->sqlvar[i].sqldata = (char *) sqlda + offset;
sqlda->sqlvar[i].sqllen = sizeof(timestamp); sqlda->sqlvar[i].sqllen = sizeof(timestamp);
break; break;
...@@ -545,7 +545,7 @@ ecpg_set_native_sqlda(int lineno, struct sqlda_struct ** _sqlda, const PGresult ...@@ -545,7 +545,7 @@ ecpg_set_native_sqlda(int lineno, struct sqlda_struct ** _sqlda, const PGresult
sqlda->sqlvar[i].sqllen = sizeof(date); sqlda->sqlvar[i].sqllen = sizeof(date);
break; break;
case ECPGt_timestamp: case ECPGt_timestamp:
ecpg_sqlda_align_add_size(offset, sizeof(timestamp), sizeof(timestamp), &offset, &next_offset); ecpg_sqlda_align_add_size(offset, sizeof(int64), sizeof(timestamp), &offset, &next_offset);
sqlda->sqlvar[i].sqldata = (char *) sqlda + offset; sqlda->sqlvar[i].sqldata = (char *) sqlda + offset;
sqlda->sqlvar[i].sqllen = sizeof(timestamp); sqlda->sqlvar[i].sqllen = sizeof(timestamp);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment