Skip to content

Symbol "#" is valid for identifiers for Oracle platform #237

Open
@ZVanoZ

Description

@ZVanoZ

Bug Report

Q A
Version(s) 2.13.4

Summary

-- For example, this SQL is valid
SELECT t.ROLE# AS ROLE_ID, t.NOTE AS NOTE, t.IS_USED AS IS_USED FROM BILL.V$LAW_ROLES t

-- laminas-db do invalid SQL
 SELECT "t"."ROLE""#" AS "ROLE_ID", "t"."NOTE" AS "NOTE", "t"."IS_USED" AS "IS_USED" FROM "BILL.V$LAW_ROLES" "t"
/*
Laminas\Db\Adapter\Exception\RuntimeException

File:    /app/vendor/laminas/laminas-db/src/Adapter/Driver/Oci8/Statement.php:243
Message:    ORA-03001: unimplemented feature
*/

For fix the error, just add symbol "#" in platform pattern

// src/Adapter/Platform/Oracle.php
namespace Laminas\Db\Adapter\Platform;
class Oracle extends AbstractPlatform
{
   /**
   * Override pattern '/([^0-9,a-z,A-Z$_:])/i' 
   * This pattern in "src/Adapter/Platform/AbstractPlatform.php "
   */
    protected $quoteIdentifierFragmentPattern = '/([^0-9,a-z,A-Z$_:#])/i';
//...

Current behavior

Generated SQL is invalid.

How to reproduce

Re-generate the request above

Expected behavior

Symbol "#" does not quote.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions