comparison main/database/src/converters.cc @ 11709:4f95e5c4a57a octave-forge

Don't restrict bytea representation to be one-dimensional anymore.
author i7tiol
date Sat, 18 May 2013 10:30:40 +0000
parents efca9c2a8a7e
children 4f5471a9bce6
comparison
equal deleted inserted replaced
11708:efca9c2a8a7e 11709:4f95e5c4a57a
345 345
346 int from_octave_bin_bytea (const octave_pq_connection &conn, 346 int from_octave_bin_bytea (const octave_pq_connection &conn,
347 const octave_value &ov, oct_pq_dynvec_t &val) 347 const octave_value &ov, oct_pq_dynvec_t &val)
348 { 348 {
349 uint8NDArray b = ov.uint8_array_value (); 349 uint8NDArray b = ov.uint8_array_value ();
350
351 if (! error_state)
352 {
353 dim_vector dv = b.dims ();
354 if (dv.length () > 2 || (dv(0) > 1 && dv(1) > 1))
355 error ("bytea representation must be one-dimensional");
356 }
357 350
358 if (error_state) 351 if (error_state)
359 { 352 {
360 error ("can not convert octave_value to bytea representation"); 353 error ("can not convert octave_value to bytea representation");
361 return 1; 354 return 1;