Issue #2809 has been updated by Brice Figureau.

Jesse Wolfe wrote:
> I can't reproduce this on 0.25.x, we don't seem to have a uniqueness 
> constraint on that table at all right now.
> Do you think it's possible that your database schema is in a different state 
> that what I've got?

You're right, I'm running with a stricter schema (and with more indices too) 
than the one defined in puppet (which I once wanted to push upstream, but never 
really finished), and I totally forgot about it.
Feel free to reject the bug then.

Anyway, this still would be an issue for instance with the following manifest:
<pre>
 @@file {
   "/tmp/A": content => "A";
   "/tmp/a": content => "a";
 }
 File <<| title == "/tmp/a" |>>
</pre>

This would certainly load the "/tmp/A" resource and not the one we want it to 
load. The result is not deterministic.
The problem is the same with tag names.

----------------------------------------
Bug #2809: storeconfigs: with mysql impossible to have resource title differing 
in case
http://projects.reductivelabs.com/issues/2809

Author: Brice Figureau
Status: Needs more information
Priority: Low
Assigned to: Brice Figureau
Category: Rails
Target version: 
Affected version: 0.25.1
Keywords: 
Branch: 


With the following resource:

<pre>
file {
  "/etc/sv/m44-test/env/MEMOIR44_HOME": content => "content";
  "/etc/sv/m44-test/env/memoir44_HOME": ensure => absent;
}
</pre>

I get:
<pre>
Mysql::Error: Duplicate entry '/etc/sv/m44-test/env/MEMOIR44_HOME-File-116' for 
key 2: INSERT INTO `resources` (`exported`, `title`, `line`, `updated_at`, 
`restype`, `source_file_id`, `host_id`) VALUES(0, 
'/etc/sv/m44-test/env/MEMOIR44_HOME', 103, '2009-11-12 17:00:08', 'File', 85, 
116)
</pre>

The problem is that a VARCHAR field in MySQL does a lookup in a 
case-insensitive way, so both titles are the same for the MySQL server.
I think the correct fix would be to use a BINARY VARCHAR in the schema.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--

You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.


Reply via email to