New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FB refuses to create unique index on col with no dups [CORE400] #744
Comments
Commented by: Alice F. Bird (firebirds) Date: 2005-04-17 19:48 In order for a GUID to be stored in the database in a CHAR Please post a message to the support list to discuss this |
Commented by: Alice F. Bird (firebirds) Date: 2005-04-15 19:38 Hi. This column is of type CHAR(16). The values are binary |
Commented by: Alice F. Bird (firebirds) Date: 2005-04-15 19:03 The TRANS_NO column contains empty strings (i.e data) not |
Commented by: Alice F. Bird (firebirds) Date: 2005-04-14 15:54 Adding database file. |
Modified by: Alice F. Bird (firebirds)description: SFID: 1183051# Cannont create unique index. Database running fine with gbak: ERROR: attempt to store duplicate value (visible I put together some java code to find duplicate values Windows XP SP2. I have attached the backup database. I have removed all Output from restore operation. ################################################### IBE: Starting restore. Current time: 13:37:45 IBE: Restore completed. Current time: 13:37:49. Elapsed Java test class ################################################### import java.sql.*; public class DBTest
DriverManager.getConnection("jdbc:firebirdsql:localhost:C:/PROB.FDB",
connection) throws SQLException
statement.executeQuery("SELECT * FROM
results.getBytes("TRANS_NO");
recordsMatchingCurrent(preparedStatement);
+ " records");
recordsMatchingCurrent(PreparedStatement
=> SFID: 1183051# Cannont create unique index. Database running fine with gbak: ERROR: attempt to store duplicate value (visible I put together some java code to find duplicate values Windows XP SP2. I have attached the backup database. I have removed all Output from restore operation. ################################################### IBE: Starting restore. Current time: 13:37:45 IBE: Restore completed. Current time: 13:37:49. Elapsed Java test class ################################################### import java.sql.*; public class DBTest
DriverManager.getConnection("jdbc:firebirdsql:localhost:C:/PROB.FDB",
connection) throws SQLException
statement.executeQuery("SELECT * FROM
results.getBytes("TRANS_NO");
recordsMatchingCurrent(preparedStatement);
+ " records");
recordsMatchingCurrent(PreparedStatement
|
Commented by: @pcisar database file |
Modified by: @pcisarAttachment: PROB.FBK [ 10036 ] |
Commented by: MikeStar (xsaero00) I think I have a related issue and dont want to double up. I get the same message mentioned in this ticket when I try to manually create unique index on VarChar column in table with no duplicates. I even emptied out the table and then tried to create the index but got the same message: |
Modified by: @pcisarWorkflow: jira [ 10424 ] => Firebird [ 14702 ] |
The backup attached to this ticket restores successfully on v3.0.11, v4.0.4 and v5.0.0. Shouldn't this issue be closed? |
@dyemanov Given the age of this ticket, shouldn't it just be closed? |
Submitted by: jamincat (jamincat)
Attachments:
PROB.FBK
SFID: 1183051#
Submitted By: jamincat
Cannont create unique index. Database running fine with
unique index on column. While restoring a backup the
following error was logged.
gbak: ERROR: attempt to store duplicate value (visible
to active transactions) in unique index
"SMS_GATEWAY_TRANS_NO".
I put together some java code to find duplicate values
but found none. I also used IBExpert to make the index
inactive and then active on a copy of the original
database. The same error was reported when i tried to
make the index active.
Windows XP SP2.
Firebird Super Server versions 1.5.0.4290 and 1.5.2.4731
I have attached the backup database. I have removed all
tables and columns except the one that causes the problem.
Output from restore operation.
###################################################
IBE: Starting restore. Current time: 13:37:45
gbak: opened file C:\Documents and Settings\Jamin\My
Documents\work\firebird problem\PROB.FBK
gbak: transportable backup -- data in XDR format
gbak: backup file is compressed
gbak: created database C:\Documents and
Settings\Jamin\My Documents\work\firebird
problem\PROB.FDB, page_size 4096 bytes
gbak: started transaction
gbak: restoring domain RDB$216
gbak: restoring domain RDB$217
gbak: restoring domain RDB$228
gbak: restoring domain RDB$229
gbak: restoring table SMS_GATEWAY_TRANS_DETAILS
gbak: restoring column TRANS_NO
gbak: restoring column ID
gbak: committing metadata for table
SMS_GATEWAY_TRANS_DETAILS
gbak: restoring generator SMS_GATEWAY_TRANS_DETAILS_ID
value: 5346
gbak: restoring stored procedure
SMS_GATEWAY_TRANS_DETAILS_ID
gbak: restoring parameter NUMBERTOALLOCATE for stored
procedure
gbak: restoring parameter NEWID for stored procedure
gbak: committing metadata
gbak: restoring index RDB$PRIMARY21
gbak: restoring index SMS_GATEWAY_TRANS_NO
gbak: restoring data for table SMS_GATEWAY_TRANS_DETAILS
gbak: committing data for table SMS_GATEWAY_TRANS_DETAILS
gbak: 5346 records restored
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user PUBLIC
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: restoring privilege for user SYSDBA
gbak: creating indexes
gbak: restoring index RDB$PRIMARY21
gbak: cannot commit index SMS_GATEWAY_TRANS_NO
gbak: ERROR: attempt to store duplicate value (visible
to active transactions) in unique index
"SMS_GATEWAY_TRANS_NO"
gbak: restoring index SMS_GATEWAY_TRANS_NO
gbak: finishing, closing, and going home
IBE: Restore completed. Current time: 13:37:49. Elapsed
time: 00:00:0
Java test class
###################################################
import java.sql.*;
public class DBTest
{
public static void main(String[] args)
{
try
{
Class.forName("org.firebirdsql.jdbc.FBDriver");
DriverManager.getConnection("jdbc:firebirdsql:localhost:C:/PROB.FDB",
"SYSDBA", "masterkey");
connection) throws SQLException
{
final Statement statement =
connection.createStatement();
final PreparedStatement preparedStatement =
connection.prepareStatement("SELECT * FROM
SMS_GATEWAY_TRANS_DETAILS WHERE TRANS_NO = ?");
statement.executeQuery("SELECT * FROM
SMS_GATEWAY_TRANS_DETAILS");
results.getBytes("TRANS_NO");
recordsMatchingCurrent(preparedStatement);
+ " records");
System.out.println("Found " + duplicates +
" duplicate records");
}
finally
{
results.close();
}
}
recordsMatchingCurrent(PreparedStatement
preparedStatement) throws SQLException
{
final ResultSet resultSet =
preparedStatement.executeQuery();
try
{
int count = 0;
The text was updated successfully, but these errors were encountered: