~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to db/drivers/sqlite/listtab.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include <stdlib.h>
17
17
#include <string.h>
18
18
#include <grass/dbmi.h>
 
19
#include <grass/glocale.h>
19
20
#include "globals.h"
20
21
#include "proto.h"
21
22
 
39
40
    const char *rest;
40
41
    int ret;
41
42
 
42
 
    init_error();
43
 
 
 
43
    G_debug(3, "db__driver_list_tables(): system = %d", system);
44
44
    ret = sqlite3_prepare(sqlite,
45
45
                          "select name from sqlite_master where type = 'table' or type = 'view'",
46
46
                          -1, &statement, &rest);
47
47
 
48
48
    if (ret != SQLITE_OK) {
49
 
        append_error("Cannot list tables\n");
50
 
        append_error((char *)sqlite3_errmsg(sqlite));
51
 
        report_error();
 
49
        db_d_append_error("%s\n%s",
 
50
                          _("Unable to list tables:"),
 
51
                          (char *)sqlite3_errmsg(sqlite));
 
52
        db_d_report_error();
52
53
        sqlite3_finalize(statement);
53
54
        return DB_FAILED;
54
55
    }
61
62
    ret = sqlite3_reset(statement);
62
63
    
63
64
    if (ret != SQLITE_OK) {
64
 
        append_error("Cannot list tables\n");
65
 
        append_error((char *)sqlite3_errmsg(sqlite));
66
 
        report_error();
 
65
        db_d_append_error("%s\n%s",
 
66
                          _("Unable to list tables:"),
 
67
                          (char *)sqlite3_errmsg(sqlite));
 
68
        db_d_report_error();
67
69
        sqlite3_finalize(statement);
68
70
        return DB_FAILED;
69
71
    }
73
75
    list = db_alloc_string_array(nrows);
74
76
 
75
77
    if (list == NULL) {
76
 
        append_error("Cannot db_alloc_string_array()");
77
 
        report_error();
 
78
        db_d_append_error(_("Unable to db_alloc_string_array()"));
 
79
        db_d_report_error();
78
80
        sqlite3_finalize(statement);
79
81
        return DB_FAILED;
80
82
    }