src/server/plugins/postgresql/pgtest.c

branch
webdav
changeset 317
09676b559091
parent 316
4090fc1b1c52
child 318
60870dbac94f
equal deleted inserted replaced
316:4090fc1b1c52 317:09676b559091
510 char idstr[32]; 510 char idstr[32];
511 snprintf(idstr, 32, "%" PRId64, res1_id); 511 snprintf(idstr, 32, "%" PRId64, res1_id);
512 const char* params[1] = { idstr }; 512 const char* params[1] = { idstr };
513 PGresult *result = PQexecParams( 513 PGresult *result = PQexecParams(
514 test_connection, 514 test_connection,
515 "insert into Property(resource_id, xmlns, pname, pvalue) values ($1, 'http://example.com/', 'test', 'testvalue');", 515 "insert into Property(resource_id, prefix, xmlns, pname, pvalue) values ($1, 'x', 'http://example.com/', 'test', 'testvalue');",
516 1, // number of parameters 516 1, // number of parameters
517 NULL, 517 NULL,
518 params, // parameter value 518 params, // parameter value
519 NULL, 519 NULL,
520 NULL, 520 NULL,
523 UCX_TEST_ASSERT(PQresultStatus(result) == PGRES_COMMAND_OK, "cannot create property 1"); 523 UCX_TEST_ASSERT(PQresultStatus(result) == PGRES_COMMAND_OK, "cannot create property 1");
524 PQclear(result); 524 PQclear(result);
525 525
526 result = PQexecParams( 526 result = PQexecParams(
527 test_connection, 527 test_connection,
528 "insert into Property(resource_id, xmlns, pname, pvalue) values ($1, 'http://example.com/', 'prop2', 'value2');", 528 "insert into Property(resource_id, prefix, xmlns, pname, pvalue) values ($1, 'x', 'http://example.com/', 'prop2', 'value2');",
529 1, // number of parameters 529 1, // number of parameters
530 NULL, 530 NULL,
531 params, // parameter value 531 params, // parameter value
532 NULL, 532 NULL,
533 NULL, 533 NULL,
538 538
539 // 1 property for res2 539 // 1 property for res2
540 snprintf(idstr, 32, "%" PRId64, res2_id); 540 snprintf(idstr, 32, "%" PRId64, res2_id);
541 result = PQexecParams( 541 result = PQexecParams(
542 test_connection, 542 test_connection,
543 "insert into Property(resource_id, xmlns, pname, pvalue) values ($1, 'http://example.com/', 'test', 'res2test');", 543 "insert into Property(resource_id, prefix, xmlns, pname, pvalue) values ($1, 'x', 'http://example.com/', 'test', 'res2test');",
544 1, // number of parameters 544 1, // number of parameters
545 NULL, 545 NULL,
546 params, // parameter value 546 params, // parameter value
547 NULL, 547 NULL,
548 NULL, 548 NULL,

mercurial