21 #define BUFFER_CHUNK 8192
23 int main(
int argc,
char *argv[])
31 size_t buffer_size= 0;
32 size_t buffer_total= 0;
46 printf(
"drizzle_create:failed\n");
56 while ((c = getopt(argc, argv,
"d:h:Hmp:P:u:")) != -1)
77 port= (in_port_t)atoi(optarg);
86 printf(
"\nUsage: %s [options] [query]\n", argv[0]);
87 printf(
"\t-d <db> - Use <db> for the connection\n");
88 printf(
"\t-h <host> - Connect to <host>\n");
89 printf(
"\t-H - Print this help menu\n");
90 printf(
"\t-m - Use MySQL protocol\n");
91 printf(
"\t-p <password> - Use <password> for authentication\n");
92 printf(
"\t-P <port> - Connect to <port>\n");
93 printf(
"\t-u <user> - Use <user> for authentication\n");
105 printf(
"read:%d\n", errno);
109 buffer_size+= (size_t)read_size;
114 printf(
"realloc:%d\n", errno);
119 }
while ((read_size= read(0, buffer + buffer_size,
BUFFER_CHUNK)) != 0);
121 (void)
drizzle_query(&con, &result, buffer, buffer_size, &ret);
153 printf(
"%.*s", (
int)size, field);
155 if (offset + size == total)