trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevinxu021 <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1727]Fixes for Databa...
Date Wed, 06 Jan 2016 09:44:29 GMT
Github user kevinxu021 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/244#discussion_r48940983
  
    --- Diff: core/conn/jdbc_type2/native/SrvrCommon.cpp ---
    @@ -1634,6 +1634,94 @@ short do_ExecSMD(
                             tableParam[0], inputParam[0], inputParam[1],
                             inputParam[2], inputParam[3]);
                         break;
    +                case SQL_API_SQLPROCEDURES:
    +                    if ((!checkIfWildCard(catalogNm, catalogNmNoEsc) || !checkIfWildCard(schemaNm,
schemaNmNoEsc) || !checkIfWildCard(
    +tableNm, tableNmNoEsc)) && !metadataId)
    +                    {
    +                        executeException->exception_nr = odbc_SQLSvc_GetSQLCatalogs_ParamError_exn_;
    +                        executeException->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_WILDCARD_NOT_SUPPORTED;
    +                        FUNCTION_RETURN_NUMERIC(EXECUTE_EXCEPTION,("EXECUTE_EXCEPTION"));
    +                    }
    +
    +                    if (strcmp(catalogNm,"") == 0)
    +                        strcpy(tableName1,SEABASE_MD_CATALOG);
    +                    else
    +                        strcpy(tableName1, catalogNm);
    +                    tableParam[0] = tableName1;
    +                    convertWildcard(metadataId, TRUE, schemaNm, expSchemaNm);
    +                    convertWildcardNoEsc(metadataId, TRUE, schemaNm, schemaNmNoEsc);
    +                    convertWildcard(metadataId, TRUE, tableNm, expTableNm);
    +                    convertWildcardNoEsc(metadataId, TRUE, tableNm, tableNmNoEsc);
    +                    inputParam[0] = schemaNmNoEsc;
    +                    inputParam[1] = expSchemaNm;
    +                    inputParam[2] = tableNmNoEsc;
    +                    inputParam[3] = expTableNm;
    +                    inputParam[4] = NULL;
    +
    +                    snprintf((char *)sqlString->dataValue._buffer, totalSize,
    +                        "select obj.CATALOG_NAME PROCEDURE_CAT, obj.SCHEMA_NAME PROCEDURE_SCHEM,
"
    +			"obj.OBJECT_NAME PROCEDURE_NAME, cast(NULL as varchar(10)) R1,cast(NULL as varchar(10))
R2,"
    +                        "cast(NULL as varchar(10)) R3, cast(NULL as varchar(10)) REMARKS,
cast(0 as smallint) PROCEDURE_TYPE, "
    +                        "obj.OBJECT_NAME SPECIFIC_NAME "
    +                        " from TRAFODION.\"_MD_\".OBJECTS obj "
    +                        " where "
    +                        " (obj.SCHEMA_NAME = '%s' or trim(obj.SCHEMA_NAME) LIKE '%s'
ESCAPE '\\')"
    +                        " and obj.OBJECT_TYPE='UR' "
    --- End diff --
    
    This query usually used for UI tools like DBVisualizer, SQuirreL SQL Client and so on.
It might be  good if you UDF could be listed as a SPJ, i think.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message