Comments (4)
I fix in next release
from go-ora.
there is an issue related to xorm.io
Write packet:
00000000 00 00 00 63 06 00 00 00 00 00 03 5e 00 02 80 21 |...c.......^...!|
00000010 00 01 01 16 01 01 0d 00 00 00 00 04 3f ff ff ff |............?...|
00000020 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 16 44 52 4f 50 |............DROP|
00000040 20 54 41 42 4c 45 20 60 49 53 53 55 45 5f 33 36 | TABLE `ISSUE_36|
00000050 33 60 01 01 01 01 00 00 00 00 00 00 00 02 80 00 |3`..............|
00000060 00 00 00 |...|
table name is surround with back quote
which produce error
00000000 00 00 00 55 06 20 00 00 00 00 04 01 02 01 1f 00 |...U. ..........|
00000010 02 03 8f 00 00 01 06 01 0b 00 00 00 00 00 00 03 |................|
00000020 02 14 93 00 00 02 9a cf 01 01 00 00 00 00 00 00 |................|
00000030 00 00 00 02 03 8f 00 1d 4f 52 41 2d 30 30 39 31 |........ORA-0091|
00000040 31 3a 20 69 6e 76 61 6c 69 64 20 63 68 61 72 61 |1: invalid chara|
00000050 63 74 65 72 0a |cter.|
2023-05-12T20:09:12.9623: Summary: RetCode:911, Error Message:"ORA-00911: invalid character"
so table doesn't drop
from go-ora.
Yes, I forked the xorm library and made the following changes:
diff --git a/dialects/oracle.go b/dialects/oracle.go
index 72c26ce..b0c5c38 100644
--- a/dialects/oracle.go
+++ b/dialects/oracle.go
@@ -609,7 +609,7 @@ func (db *oracle) IsReserved(name string) bool {
}
func (db *oracle) DropTableSQL(tableName string) (string, bool) {
- return fmt.Sprintf("DROP TABLE `%s`", tableName), false
+ return fmt.Sprintf("DROP TABLE \"%s\"", tableName), false
}
func (db *oracle) CreateTableSQL(ctx context.Context, queryer core.Queryer, table *schemas.Table, tableName string) (string, bool, error) {
@@ -645,6 +645,10 @@ func (db *oracle) CreateTableSQL(ctx context.Context, queryer core.Queryer, tabl
return sql, false, nil
}
+func (db *oracle) IsSequenceExist(ctx context.Context, queryer core.Queryer, seqName string) (bool, error) {
+ return db.HasRecords(queryer, ctx, `SELECT sequence_name FROM user_sequences WHERE sequence_name = :1`, seqName)
+}
+
func (db *oracle) SetQuotePolicy(quotePolicy QuotePolicy) {
switch quotePolicy {
case QuotePolicyNone:
from go-ora.
fixed in v2.7.6
from go-ora.
Related Issues (20)
- OCI IAM Token Authentication support in ADB HOT 1
- SELECT FOR UPDATE causing array out of bounds and panic HOT 1
- 2.8.10 is returning int column as string HOT 10
- ORA-00911: invalid character HOT 1
- ORA-00900: invalid SQL statement
- go_ora.AddSessionParam(db, k, v) put values to global driver hashmap HOT 2
- An EOF error is reported during ping HOT 2
- Panic in v2 `network.Session.GetInt64`: slice out of bounds HOT 3
- 2.8.8 drop JSON support? ORA-40569: Unimplemented JSON feature. HOT 5
- Insert with returning value using prepared statement hanging HOT 2
- unregister custom type: ANYDATA. call RegisterType first HOT 3
- long type get a error(ORA-03146:invalid buffer length for TTC field) HOT 5
- All data types are cast to string when query results are parsed HOT 5
- Connection error on v2.8.12 HOT 10
- Timestamp with Local Time Zone conversion HOT 8
- 'ORA-03146: invalid buffer length for TTC field' on procedure call with out parameter
- ORA-01013 in v2.8.13 HOT 24
- 'ORA-01009: missing mandatory parameter' during select for CLOB columns on 2.8.13 HOT 2
- Use struct with Select many rows query HOT 3
- The canceling context in version 2.8.14 has a race condition issue. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-ora.