Compare commits

...

4 Commits

Author SHA1 Message Date
opengauss-bot 2586b083e8
!2320 修复gsql无法在openGauss2.0上执行"\d+ table"的问题
Merge pull request !2320 from 杨浩/3.1.0
2022-10-27 08:01:49 +00:00
yanghao d616290f7d Fix "\d+ table" cannot be executed in openGauss 2.0 2022-10-27 10:11:01 +08:00
opengauss-bot b5eb8164d0
!2325 虚拟索引oid最大值设定
Merge pull request !2325 from guoguozhenhaowan/index_oid_3.1.0
2022-10-26 03:16:41 +00:00
nwen f65e5f8992 fix: increase the maximum value of oid to avoid the bug of not being able to create hypo-index by too large oid 2022-10-24 15:46:13 +08:00
2 changed files with 6 additions and 6 deletions

View File

@ -1342,13 +1342,13 @@ static bool describeOneTableDetails(const char* schemaname, const char* relation
* So we need to turn off it temporarily, and turn on it at the end.
*/
bool uppercaseIsOn = false;
printfPQExpBuffer(&buf, "show uppercase_attribute_name;");
printfPQExpBuffer(&buf, "select setting from pg_settings where name = 'uppercase_attribute_name';");
res = PSQLexec(buf.data, false);
if (NULL == res) {
goto error_return;
}
uppercaseIsOn = strcmp(PQgetvalue(res, 0, 0), "on") == 0;
uppercaseIsOn = PQntuples(res) == 1 && strcmp(PQgetvalue(res, 0, 0), "on") == 0;
PQclear(res);
res = NULL;
@ -3350,7 +3350,7 @@ static void add_role_attribute(PQExpBuffer buf, const char* const str)
/*
* \drds
*/
bool listDbRoleSettings(const char* pattern, const char* pattern2)
bool listDbRoleSettings(const char* pattern1, const char* pattern2)
{
PQExpBufferData buf;
PGresult* res = NULL;
@ -3367,7 +3367,7 @@ bool listDbRoleSettings(const char* pattern, const char* pattern2)
"FROM pg_db_role_setting AS s\n"
"LEFT JOIN pg_database ON pg_database.oid = setdatabase\n"
"LEFT JOIN pg_roles ON pg_roles.oid = setrole\n");
havewhere = processSQLNamePattern(pset.db, &buf, pattern, false, false, NULL, "pg_roles.rolname", NULL, NULL);
havewhere = processSQLNamePattern(pset.db, &buf, pattern1, false, false, NULL, "pg_roles.rolname", NULL, NULL);
(void)processSQLNamePattern(pset.db, &buf, pattern2, havewhere, false, NULL, "pg_database.datname", NULL, NULL);
appendPQExpBufferStr(&buf, "ORDER BY role, database;");
} else {
@ -3383,7 +3383,7 @@ bool listDbRoleSettings(const char* pattern, const char* pattern2)
}
if (PQntuples(res) == 0 && !pset.quiet) {
if (pattern != NULL)
if (pattern1 != NULL)
fprintf(pset.queryFout, _("No matching settings found.\n"));
else
fprintf(pset.queryFout, _("No settings found.\n"));

View File

@ -1285,7 +1285,7 @@ Datum hypopg_reset_index(PG_FUNCTION_ARGS)
*/
static void hypo_set_indexname(hypoIndex *entry, const char *indexname)
{
char oid[12] = {0}; /* store <oid>, oid shouldn't be more than 9999999999 */
char oid[16] = {0}; /* store <oid>, oid shouldn't be more than 99999999999999 */
int totalsize;
errno_t rc = EOK;