Skip to content

Table naming case sensitivity issue #130

Open
@borisjotic

Description

@borisjotic

Summary of problem or feature request

I have issue with table naming case sensitivity. As far as I can debug this probably isn't the place for this issue, but any help will be higlhy appreciated.

In development environment, everything (same php, same oracle db, but not iis) under docker everything works, DB created via Laravel's migrations. TEST/PROD DB are created long long time ago.

Additional hint: setting PDO::ATTR_CASE in yajra/laravel-oci8 doesn't work, somehow is totally ignored.

Code snippet of problem

Non working:

In tinker execute any of following code:

  • TableName::all()
  • DB::connection('oracle')->table('table_name')->select('*')->first();
    The repsonse is following error:
Illuminate\Database\QueryException with message 'Error Code    : 942
Error Message : ORA-00942: table or view does not exist
Position      : 29
Statement     : select * from (select * from "TABLE_NAME") where rownum = 1
Bindings      : []
 (SQL: select * from (select * from "TABLE_NAME") where rownum = 1)'

Working (narrowing the problem)

Create some random api endpoint with following content:

\DB::enableQueryLog();
    $query = <<<END
SELECT * FROM "table_name" WHERE ROWNUM = 1
END;

    $tables = \DB::connection('oracle')->select($query);

    dd($tables); // ok

If I manually update following file vendor\yajra\laravel-oci8\src\Oci8\Query\Grammars\OracleGrammar.php by commenting out 275th ($value = Str::upper($value);) line everything works. I know that this isn't the way, but I needed somehow to narrow search.

System details

Server:

  • Windows Server 2016 Standard
  • IIS version 10

Database:

  • Oracle 11g
  • Oracle instant client 11.2

Tech stack:

  • Laravel version 8
  • PHP 8.0.29( NTS Visual C++ 2019 x86 )
  • ORM: yajra/laravel-oci8 version 8.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions