View | Details | Raw Unified | Return to bug 38645 | Differences between
and this patch

Collapse All | Expand All

(-)modules/univention/s4connector/s4cache.py (-6 / +6 lines)
 Lines 276-282    Link Here 
276
			for value in entry[attr]:
276
			for value in entry[attr]:
277
				sql_commands.append(
277
				sql_commands.append(
278
					(
278
					(
279
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", [str(guid_id), str(attr_id), _encode_base64(value)]
279
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", (str(guid_id), str(attr_id), _encode_base64(value))
280
					)
280
					)
281
				)
281
				)
282
282
 Lines 297-304    Link Here 
297
				(
297
				(
298
				"DELETE FROM data WHERE data.id IN (\
298
				"DELETE FROM data WHERE data.id IN (\
299
				SELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \
299
				SELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \
300
					where attributes.attribute=? and guid_id =? \
300
					where attributes.attribute=? and guid_id=? \
301
				);", [ (str(attribute),), (str(guid_id),)]
301
				);", (str(attribute), str(guid_id))
302
				)
302
				)
303
			)
303
			)
304
		for attribute in diff['added']:
304
		for attribute in diff['added']:
 Lines 306-312    Link Here 
306
			for value in entry[attribute]:
306
			for value in entry[attribute]:
307
				sql_commands.append(
307
				sql_commands.append(
308
					(
308
					(
309
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", [str(guid_id), str(attr_id), _encode_base64(value)]
309
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", (str(guid_id), str(attr_id), _encode_base64(value))
310
					)
310
					)
311
				)
311
				)
312
		for attribute in diff['changed']:
312
		for attribute in diff['changed']:
 Lines 317-329    Link Here 
317
						"DELETE FROM data WHERE data.id IN (\
317
						"DELETE FROM data WHERE data.id IN (\
318
							SELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \
318
							SELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \
319
							where attributes.id=? and guid_id = ? and value = ? \
319
							where attributes.id=? and guid_id = ? and value = ? \
320
						);", [str(attr_id), str(guid_id), _encode_base64(value)]
320
						);", (str(attr_id), str(guid_id), _encode_base64(value))
321
					)
321
					)
322
				)
322
				)
323
			for value in set(entry.get(attribute)) - set(old_entry.get(attribute)):
323
			for value in set(entry.get(attribute)) - set(old_entry.get(attribute)):
324
				sql_commands.append(
324
				sql_commands.append(
325
					(
325
					(
326
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", [str(guid_id), str(attr_id), _encode_base64(value)]
326
						"INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);", (str(guid_id), str(attr_id), _encode_base64(value))
327
					)
327
					)
328
				)
328
				)
329
329

Return to bug 38645