[Firebird-net-provider] [FB-Tracker] Created: (DNET-746) FbScript Exception

2017-03-24 Thread Marcos R. Weimer (JIRA)
FbScript Exception
--

 Key: DNET-746
 URL: http://tracker.firebirdsql.org/browse/DNET-746
 Project: .NET Data provider
  Issue Type: Bug
  Components: ADO.NET Provider
Affects Versions: 5.8.0.0
 Environment: Visual Studio 2015 / target .Net Framework 4.0
Reporter: Marcos R. Weimer
Assignee: Jiri Cincura


- Read script file and execute:
- Multiple lines with comments
- null except in execute this specific line: "delete from 
custo_reposicao_atual;  -- deletar tudo pq na 514 teve alteracoes e pode estar 
errado o custo"

Example:

ExecuteScript("delete from custo_reposicao_atual;  -- deletar tudo pq na 514 
teve alteracoes e pode estar errado o custo") 

public void ExecuteScript(string ASQL)
{
FbScript sc = new FbScript(ASql);

sc.Parse(); ---> exception here
FbBatchExecution fbe = new FbBatchExecution(FConexao);
fbe.AppendSqlStatements(sc);
fbe.Execute();
}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


[Firebird-net-provider] [firebird-support] Create Autoincrement

2017-03-24 Thread Clyde Eisenbeis
Using http://www.firebirdfaq.org/faq29/ as a reference.

1) If I understand this website, the CREATE GENERATOR is initiated only once?

2) Likewise the CREATE TRIGGER is initiated only once?

3) When is the T1_BI used (CREATE TRIGGER T1_BI FOR T1)?

4) I see the 'id' field in table t1.  I see upper case 'ID' in the
TRIGGER.  Are these two the same?

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


[Firebird-net-provider] [FB-Tracker] Created: (DNET-745) Collection was modified; enumeration operation may not execute.

2017-03-24 Thread Paul Reeves (JIRA)
Collection was modified; enumeration operation may not execute.
---

 Key: DNET-745
 URL: http://tracker.firebirdsql.org/browse/DNET-745
 Project: .NET Data provider
  Issue Type: Bug
Affects Versions: 5.8.0.0
 Environment: .Net 4 and4.5
Reporter: Paul Reeves
Assignee: Jiri Cincura


We have a client that have found what appears to be a bug in v5.8.0.0

The code and the stack trace are attached below.

The same code works fine with all versions between 4.1 and 5.7

They've also tested with .Net framework 4 and 4.5

They are happy to run a debug build to help fix this, but have not been able to 
create a test case.



#if DEBUG
  var cmd = "select s.S_SHOPID, s.S_VALUE as FOO, s1.S_VALUE as BAR, 
s2.S_VALUE as SNAFU " +
"from SYSTEMSETTING s " +
"left join SYSTEMSETTING s1 on s.S_SHOPID = s1.S_SHOPID " +
"left join SYSTEMSETTING s2 on s.S_SHOPID = s2.S_SHOPID " +
"where s.S_SYSTEM_ID = 9202 " +
"and s1.S_SYSTEM_ID = 9200 " +
"and s2.S_SYSTEM_ID = 9201 " +
"and s.S_VALUE = 'Y' " +
"and s1.S_VALUE <> '' " +
"and s2.S_VALUE <> ''";
  using (FbCommand fbCmd = new FbCommand(cmd)) {
using (DataTable myDT = new DataTable()) {
  using (FbDataAdapter da = new FbDataAdapter()) {
da.SelectCommand = fbCmd;
fbCmd.Connection = DbConnection;

try {
  LogFile.Log("Before Data Adapter.Fill() call. Managed Thread ID: 
" + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString(), true);
  da.Fill(myDT);
  LogFile.Log("After Data Adapter.Fill() call. Managed Thread ID: " 
+ System.Threading.Thread.CurrentThread.ManagedThreadId.ToString(), true);
  foreach (DataRow row in myDT.Rows) {
LogFile.Log("Row Logged");
  }
}
catch (Exception e) {
  LogFile.Log("**--- ERROR ---**", true);
  LogFile.Log("Managed Thread ID: " + 
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString());
  LogFile.Log("Error Message: " + e.Message);
  LogFile.Log("Error Message: " + e.StackTrace);
}
  }
}
  }
  LogFile.Log("After Select via SQL Test. Managed Thread ID: " + 
System.Threading.Thread.CurrentThread.ManagedThreadId.ToString(), true);
#endif



Tuesday 21 March 2017 01:20:07.308 PM

  :Before Select via SQL Test. Managed Thread ID: 4
  :FirebirdSql.Data.FirebirdClient version: 5.8.0.0

Tuesday 21 March 2017 01:20:07.308 PM

  :Before Data Adapter.Fill() call. Managed Thread ID: 4

Tuesday 21 March 2017 01:20:07.313 PM

  :**--- ERROR ---**
  :Managed Thread ID: 4
  :Error Message: Collection was modified; enumeration operation may not 
execute.
  :Error Message:at 
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Linq.Enumerable.d__24`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at FirebirdSql.Data.Client.Managed.XdrStream.Read(Byte[] buffer, Int32 
offset, Int32 count) in 
C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line
 249
   at FirebirdSql.Data.Client.Managed.XdrStream.ReadBytes(Int32 count) in 
C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line
 336
   at FirebirdSql.Data.Client.Managed.XdrStream.ReadOpaque(Int32 length) in 
C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line
 348
   at FirebirdSql.Data.Client.Managed.GdsConnection.ProcessOperation(Int32 
operation, XdrStream xdr) in 
C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\GdsConnection.cs:line
 362
   at 
FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadSingleResponse() in 
C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:line
 638
   at 

Re: [Firebird-net-provider] [firebird-support] Create Autoincrement

2017-03-24 Thread Scott Morgan
On 03/24/2017 03:09 PM, Clyde Eisenbeis wrote:
> Using http://www.firebirdfaq.org/faq29/ as a reference.
> 
> 1) If I understand this website, the CREATE GENERATOR is initiated only once?

Yes. It's a global item like a table, so you just need to create it once
(and commit that change to the DB,. Changes to tables and other global
items like that all need to be committed before using them). It'll have
an initial value of 0 and calls to GEN_ID will increment it by the
specified value (usually 1)

> 2) Likewise the CREATE TRIGGER is initiated only once?

Yes. It's just associated with the table, ready to run whenever the
specific event happens, so...

> 3) When is the T1_BI used (CREATE TRIGGER T1_BI FOR T1)?

The "ACTIVE BEFORE INSERT POSITION 0" specifies that. In this case
'BEFORE INSERT', so whenever a new item is inserted into the table, that
trigger is run.

> 4) I see the 'id' field in table t1.  I see upper case 'ID' in the
> TRIGGER.  Are these two the same?

Yes. (Bit of bad form in that FAQ there I'd say, mixing case) Unquoted
identifiers (names of tables, columns, etc.) are stored in upper case.
So id, ID, iD, and Id are all the same (ID).


You'll get more detailed answers about this stuff on the main Firebird
mailing list, and I highly recommend the Firebird Book by Helen Borrie,
which covers all this clearly and in depth. It's things like triggers
and foreign keys that make a proper DB so powerful, but it can take a
bit of getting used to.

Scott


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider