Bug #80156 | HasDefaultSchema TableFragment From Clause SchemaName Missing | ||
---|---|---|---|
Submitted: | 26 Jan 2016 15:43 | Modified: | 5 Feb 2016 13:21 |
Reporter: | Kai Scheddin | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.9.3 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | DefaultSchema, HasDefaultSchema, incorrect, schema, SELECT, TableFragment, WriteSql |
[26 Jan 2016 15:43]
Kai Scheddin
[26 Jan 2016 15:46]
Kai Scheddin
Synopsis changed
[26 Jan 2016 17:47]
Kai Scheddin
Corrected Fix: public override void WriteSql(StringBuilder sql) { if (DefiningQuery != null) sql.AppendFormat("({0})", DefiningQuery); else { string _schemaName = Schema; string _tableName = Table; if (_schemaName.ToLowerInvariant().Equals("dbo")) _schemaName = ""; if (!String.IsNullOrEmpty(_schemaName) && !String.IsNullOrWhiteSpace(_schemaName)) _tableName = String.Format("{0}.{1}", Schema, Table); sql.AppendFormat("{0}", QuoteIdentifier(_tableName)); } base.WriteSql(sql); #if DEBUG System.Diagnostics.Debug.WriteLine("TableFragment: " + sql.ToString()); #endif }
[5 Feb 2016 13:21]
Chiranjeevi Battula
Hello Kai Scheddin, Thank you for the bug report. This is most likely duplicate of Bug #73205, please see Bug #73205. Thanks, Chiranjeevi.