35 return (table =
NULL);
42 return (table =
NULL);
45 for (i = 0; i < ncols; i++)
143 static void set_all_column_privs(
dbTable *table,
144 void (*set_column_priv)(
dbColumn *))
150 for (col = 0; col < ncols; col++) {
152 set_column_priv(column);
156 static int get_all_column_privs(
dbTable *table,
159 int priv, col, ncols;
163 for (col = 0; col < ncols; col++) {
165 priv = get_column_priv(column);
330 for (i = 0; i <
columns; i++) {
408 for (i = 0; i < n; i++) {
413 new->priv_delete =
src->priv_delete;
414 new->priv_insert =
src->priv_insert;
442 for (col = 0; col < ncols; col++) {
467 G_warning(
"Type TEXT converted to 'VARCHAR(250)'");
491 G_warning(
"Unknown column type (%s)", colname);
#define DB_SQL_TYPE_INTEGER
struct _db_column dbColumn
#define DB_SQL_TYPE_SMALLINT
#define DB_SQL_TYPE_NUMERIC
#define DB_SQL_TYPE_INTERVAL
#define DB_SQL_TYPE_DOUBLE_PRECISION
#define DB_SQL_TYPE_DECIMAL
#define DB_SQL_TYPE_CHARACTER
#define DB_SQL_TYPE_TIMESTAMP
void db_set_table_update_priv_not_granted(dbTable *table)
Set update privileges not granted for all columns.
int db_table_to_sql(dbTable *table, dbString *sql)
Create SQL CREATE string from table definition.
int db_get_table_number_of_columns(dbTable *table)
Return the number of columns of the table.
int db_set_table_name(dbTable *table, const char *name)
Set the name of the table.
int db_get_table_insert_priv(dbTable *table)
Get table insert privileges.
dbTable * db_alloc_table(int ncols)
Allocate a table with a specific number of columns.
int db_get_table_select_priv(dbTable *table)
Get table select privileges.
int db_get_table_update_priv(dbTable *table)
Get table update privileges.
dbTable * db_clone_table(dbTable *src)
Make a new exact copy of an existing table.
void db_set_table_update_priv_granted(dbTable *table)
Grant update privileges for all columns.
void db_set_table_delete_priv_not_granted(dbTable *table)
Set delete privileges not granted for table.
void db_set_table_delete_priv_granted(dbTable *table)
Grant delete privileges for table.
void db_set_table_insert_priv_not_granted(dbTable *table)
Set insert privileges not granted for table.
const char * db_get_table_name(dbTable *table)
Get the name of the table.
void db_free_table(dbTable *table)
Free the table.
int db_set_table_description(dbTable *table, const char *description)
Set the description of the table.
void db_set_table_insert_priv_granted(dbTable *table)
Grant insert privileges for table.
dbColumn * db_get_table_column_by_name(dbTable *table, const char *name)
Returns column structure for given table and column name.
int db_get_table_delete_priv(dbTable *table)
Get table delete privileges.
const char * db_get_table_description(dbTable *table)
Get the description of the table.
void db_set_table_select_priv_not_granted(dbTable *table)
Set selection privileges not granted for all columns.
void db_set_table_select_priv_granted(dbTable *table)
Grant selection privileges for all columns.
int db_set_table_column(dbTable *table, int idx, dbColumn *column)
Set a specific column for given table and column number.
dbColumn * db_get_table_column(dbTable *table, int idx)
Returns column structure for given table and column number.
void db_init_table(dbTable *table)
Initialize the table to zero.
int db_append_table_column(dbTable *table, dbColumn *column)
Append a specific column to given table.
const char * db_sqltype_name(int)
Get SQL data type description.
int db_get_column_select_priv(dbColumn *)
Get select privileges.
void db_set_column_update_priv_not_granted(dbColumn *)
Unset update privileges.
int db_copy_string(dbString *, const dbString *)
Copy dbString.
int db_get_column_length(dbColumn *)
Get column's length.
dbColumn * db_copy_column(dbColumn *, dbColumn *)
Copy a db column from source to destination.
void db_set_column_select_priv_not_granted(dbColumn *)
Unset select privileges.
void * db_calloc(int, int)
Allocate memory.
int db_get_column_sqltype(dbColumn *)
Returns column sqltype for column.
void db_free_string(dbString *)
Free allocated space for dbString.
void db_set_column_select_priv_granted(dbColumn *)
Set select privileges to be granted.
void db_set_column_update_priv_granted(dbColumn *)
Set update privileges to be granted.
int db_set_string(dbString *, const char *)
Inserts string to dbString (enlarge string)
void db_init_column(dbColumn *)
Initialize dbColumn.
void db_free(void *)
Free allocated memory.
void db_free_column(dbColumn *)
Frees column structure.
void db_zero(void *, int)
Zero allocated space.
void db_init_string(dbString *)
Initialize dbString.
const char * db_get_column_name(dbColumn *)
Returns column name for given column.
int db_append_string(dbString *, const char *)
Append string to dbString.
int db_get_column_update_priv(dbColumn *)
Get update privileges.
char * db_get_string(const dbString *)
Get string.
void * db_realloc(void *, int)
Reallocate memory.
void * db_malloc(int)
Allocate memory.
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf