| 1000 | // |
| 1001 | |
| 1002 | void SQL_relation_name(TEXT* r_name, TEXT* db_name, TEXT* owner_name) |
| 1003 | { |
| 1004 | db_name[0] = 0; |
| 1005 | owner_name[0] = 0; |
| 1006 | |
| 1007 | SQL_resolve_identifier("<Database name>", NULL, NAME_SIZE + 1); |
| 1008 | if (gpreGlob.token_global.tok_length >= NAME_SIZE) |
| 1009 | PAR_error("Database alias too long"); |
| 1010 | |
| 1011 | gpre_sym* symbol = MSC_find_symbol(gpreGlob.token_global.tok_symbol, SYM_database); |
| 1012 | if (symbol) |
| 1013 | { |
| 1014 | if (strlen(symbol->sym_name) >= unsigned(NAME_SIZE)) |
| 1015 | PAR_error("Database alias too long"); |
| 1016 | |
| 1017 | strcpy(db_name, symbol->sym_name); // this is the alias, not the path |
| 1018 | PAR_get_token(); |
| 1019 | if (!MSC_match(KW_DOT)) |
| 1020 | CPR_s_error(". (period)"); |
| 1021 | } |
| 1022 | |
| 1023 | SQL_resolve_identifier("<Table name>", NULL, NAME_SIZE + 1); |
| 1024 | if (gpreGlob.token_global.tok_length >= NAME_SIZE) |
| 1025 | PAR_error("Table or owner name too long"); |
| 1026 | |
| 1027 | strcpy(r_name, gpreGlob.token_global.tok_string); |
| 1028 | PAR_get_token(); |
| 1029 | |
| 1030 | if (MSC_match(KW_DOT)) |
| 1031 | { |
| 1032 | // the table name was really a owner specifier |
| 1033 | strcpy(owner_name, r_name); |
| 1034 | SQL_resolve_identifier("<Table name>", NULL, NAME_SIZE); |
| 1035 | if (gpreGlob.token_global.tok_length >= NAME_SIZE) |
| 1036 | PAR_error("TABLE name too long"); |
| 1037 | |
| 1038 | strcpy(r_name, gpreGlob.token_global.tok_string); |
| 1039 | PAR_get_token(); |
| 1040 | } |
| 1041 | } |
| 1042 | |
| 1043 | |
| 1044 | //____________________________________________________________ |
no test coverage detected